Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14547 closed bug (notabug)

.find method has different response in different jQuery

Reported by: rqx110@… Owned by:
Priority: undecided Milestone: None
Component: selector Version: 2.0.3
Keywords: Cc:
Blocked by: Blocking:

Description

I have a DOM on the page:

<div id="SearchContainer"><input type="text" value /><input type="text" value/></div>

.

I use

$("#SearchContainer").find('input[type="text"][value!=""]')

to try select the input object which value is not empty.

in jquery 1.7, I run the code and type some text string into textbox, and run the jquery code, it return the input object which I had typed.

in jquery 1.9.1/2.0, do the same job as above, but it doesn't return the input object.

*I have not test other version of jQuery.

Change History (1)

comment:1 Changed 6 years ago by gibson042

Component: unfiledselector
Resolution: notabug
Status: newclosed

[value!=""] is an attribute selector, which jQuery versions before 1.9 erroneously and inconsistently tried to apply against the value property: http://jquery.com/upgrade-guide/1.9/#attr-versus-prop-

Note: See TracTickets for help on using tickets.