Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10731 closed bug (duplicate)

jq1.7 selector [value=""] Something wrong

Reported by: [email protected] Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

http://jsfiddle.net/WZmqg/1/

[value=""] not correct when input's value changed (ie is ok)

[value=] correct when input's value changed

Change History (3)

comment:1 Changed 10 years ago by timmywil

Component: unfiledattributes
Priority: undecidedlow
Resolution: duplicate
Status: newclosed

The deprecation of the value hook will fix this.

comment:2 Changed 10 years ago by timmywil

Duplicate of #9830.

comment:3 Changed 10 years ago by timmywil

But not in the way you expect. It's actually IE that is wrong in this case. Keep in mind that the value attribute does not stay up to date with the current value, but only sets the default value. To select an input by their current value, you can do this:

$('input').filter(function() {
    return this.value === 'something';
});
Note: See TracTickets for help on using tickets.