Skip to main content

Bug Tracker

Side navigation

#10731 closed bug (duplicate)

Opened November 09, 2011 09:21AM UTC

Closed November 09, 2011 02:29PM UTC

Last modified November 09, 2011 02:30PM UTC

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

Reported by: dongdongface@gmail.com 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

Attachments (0)
Change History (3)

Changed November 09, 2011 02:29PM UTC by timmywil comment:1

component: unfiledattributes
priority: undecidedlow
resolution: → duplicate
status: newclosed

The deprecation of the value hook will fix this.

Changed November 09, 2011 02:29PM UTC by timmywil comment:2

Duplicate of #9830.

Changed November 09, 2011 02:30PM UTC by timmywil comment:3

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';
});