Bug Tracker

Modify

Ticket #5046 (closed bug: wontfix)

Opened 4 years ago

Last modified 4 years ago

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

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

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

Change History

Changed 4 years ago by tngd

comment:1 Changed 4 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to wontfix

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.

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.