Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8058 closed bug (duplicate)

attribute ends with selector breaks in 1.4.4

Reported by: gerads@… 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:2 Changed 9 years ago by jitter

Component: unfiledselector
Milestone: 1.next1.5
Priority: undecidedblocker
Resolution: duplicate
Status: newclosed

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

comment:3 Changed 9 years ago by jitter

Duplicate of #6093.

Note: See TracTickets for help on using tickets.