Side navigation
#8058 closed bug (duplicate)
Opened January 25, 2011 11:17PM UTC
Closed January 25, 2011 11:57PM UTC
Last modified February 26, 2011 12:22PM UTC
attribute ends with selector breaks in 1.4.4
Reported by: | gerads@gmail.com | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.5 |
Component: | selector | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$(':input[name$=[bar]]') no longer works correctly with the latest update.
<input type='text' name='foo[bar]'> <script src="http://code.jquery.com/jquery-1.4.4.js"></script> <script> console.log('1.4.4: ' + $(':input[name$=[bar]]').length); // => 0 </script> <script src="http://code.jquery.com/jquery-1.4.3.js"></script> <script> console.log('1.4.3: ' + $(':input[name$=[bar]]').length); // => 1 </script>
Attachments (0)
Change History (4)
Changed January 25, 2011 11:20PM UTC by comment:1
Changed January 25, 2011 11:57PM UTC by comment:2
component: | unfiled → selector |
---|---|
milestone: | 1.next → 1.5 |
priority: | undecided → blocker |
resolution: | → duplicate |
status: | new → closed |
Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a test case!
This is a known regression and has been reported numerous times. You wouldn't have run into this issue when using the syntax recommended on api.jquery.com. Which says "Quotes are mandatory." for attribute values in attribute selectors. Like this
$(':input[name$="[bar]"]')
It has been fixed, you can check that with the recently released 1.5rc1 version in this test case
Changed February 26, 2011 12:22PM UTC by comment:4
funny. http://jsfiddle.net/6fHR5/3/
http://jsfiddle.net/6F4W8/