Modify ↓
Ticket #5040 (closed bug)
Selector #foo a[href=#x/y] fails in IE7
| Reported by: | michaelmayer | Owned by: | michaelmayer |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.4 |
| Component: | selector | Version: | 1.3.2 |
| Keywords: | selector, internet explorer, ie7 | Cc: | |
| Blocking: | Blocked by: |
Description
As described in the summary, $('#foo a[href=#bar/xyz]') returns no elements in IE7, whereas it works as expected with Safari 4 and Firefox 3.5. I could not test it with IE8. It also returns elements, if I change it to $('#foo a:last') for example, so it finds anchor elements, just the attribute selector seems broken for Internet Explorer.
There was a similar bug with input[for=bar], which was broken for IE in jQuery 1.3. See #3794.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Be aware that elements generated in IE using innerHTML, .html(html), or $(html) with a href attribute will have the href attribute mangled into an absolute path in IE<8, and there is no way that we can really work around that.
If this is still a problem in current versions of jQuery, and you are not creating the elements using one of the previously mentioned methods, please submit a reduced test case. Thanks!