Bug Tracker

Opened 10 years ago

Closed 10 years ago

#5046 closed bug (wontfix)

inconsistent "input[type=text]" selector results

Reported by: tngd Owned by: john
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

I observed an inconsistency when using the selector "input[type=text]" in Firefox 3.5.2 and Chrome 2.0.172.39 (windows xp).

If I have 4 input elements, the first 2 don't have the attribute type defined, and the last 2 have an explicit type attribute with the value "text".

When using the selectors "input[type=text]" and "input[type=text]:eq(1)" I get unexpected results in FF 3.5, Chrome 2 (and IE8).

input[type=text]
FF and Chrome: the last 2 input elements are selected IE8: all 4 input elements are selected

input[type=text]:eq(1)
IE8, FF and Chrome: the second element is selected

I would expect FF and Chrome to select the fourth element and not the second since it wasn't included in the first selector results.

On the other hand, it should select all 4 elements when using the first selector to be consistent with the second selector (or/and to be consistent with IE8 results).

Test case attached.

Attachments (1)

jquery_input_bug.html (1.2 KB) - added by tngd 10 years ago.

Download all attachments as: .zip

Change History (2)

Changed 10 years ago by tngd

Attachment: jquery_input_bug.html added

comment:1 Changed 10 years ago by scottgonzalez

Resolution: wontfix
Status: newclosed

The type attribute does not behave consistently between browsers. You should use the custom selectors, e.g., :text, to search for inputs of a specific type.

Note: See TracTickets for help on using tickets.