#8058 closed bug (duplicate)
attribute ends with selector breaks in 1.4.4
Reported by: | 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>
Change History (4)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
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
Note: See
TracTickets for help on using
tickets.
http://jsfiddle.net/6F4W8/