Opened 14 years ago
Closed 13 years ago
#5480 closed bug (invalid)
IE7 selector problem
Reported by: | ScorpioN | Owned by: | ScorpioN |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | selector | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi! It seems I've found a bug.
I've created several inputs dynamically and set attribute "all=1" to some of them. In FF and IE8 all works fine. But in IE7:
$('input[all]').size() == 8 AND $('input[all=1]').size() == 2 (this correct)
I'm using jquery 1.3.2.
Change History (4)
comment:1 Changed 14 years ago by
comment:2 Changed 13 years ago by
Component: | unfiled → selector |
---|
comment:3 Changed 13 years ago by
Owner: | set to ScorpioN |
---|---|
Status: | new → pending |
Can you provide a test case in jsfiddle? I'd like to know which 2 of 8 elements it found.
comment:4 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Automatically closed due to 14 days of inactivity.
Note: See
TracTickets for help on using
tickets.
I suspect the problem is that IE is adding an .all property to every element, which is a collection representing the descendant elements. It was most often used as document.all but it's available on every element. So, where there is no explicit all attribute, jQuery is seeing the all property.
In general, it's a bad idea to add nondistinctive names and properties to html elements. You might want to try "x_all" as your attribute name to avoid collisions.
This is similar to, if not the same as, #3113 which has the problem with form property name/attribute confusion.