Bug Tracker

Modify

Ticket #8751 (closed bug: duplicate)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

Description

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" );

to

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.

Thanks

Change History

comment:1 Changed 2 years ago by rwaldron

  • Priority changed from undecided to high
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to attributes

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 2 years ago by rwaldron

Duplicate of #8457.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.