Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#8751 closed bug (duplicate)

Selector for [type=foo] does not work in IE7 and lower

Reported by: alexg Owned by:
Priority: high Milestone: 1.next
Component: attributes Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:


Hi all, I'm a total noob at hacking jquery but while developing a webpage came accross this problem. In IE <=7 selectors such as $('input[type=checkbox]') don't work because of a known bug where element.getAttribute('type') returns a boolean. This is a big problem because some frameworks rely on these selectors.

I think I found a fix to this, which is to change the line 3671 in jquery-1.5.2 from:

return elem.getAttribute( "type" );


return elem.getAttributeNode( "type" ).nodeValue;

The non-shorthand version is one function call slower but works in all browsers.

I'd like someone more experienced with jquery to review this and patch the code if appropriate.


Change History (2)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfiledattributes
Priority: undecidedhigh
Resolution: duplicate
Status: newclosed

This will be address in 1.6 attrHooks feature

Also, heads up: http://api.jquery.com/attribute-equals-selector/

attribute selectors requre quotes around the attribute value

comment:2 Changed 12 years ago by Rick Waldron

Duplicate of #8457.

Note: See TracTickets for help on using tickets.