Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11345 closed bug (duplicate)

option.attr("value") is not consistent across browsers

Reported by: yiminghe Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:


step: open http://jsfiddle.net/yiminghe/L2bWk/2/ with ie6,ie7,ie8,ie9,chrome18,firefox10

expected: alert(undefined),because "value" attribute does not exist.

actual: ie67 : alert("") others : alert(2)

proposed patch: https://github.com/yiminghe/jquery/commit/456d7c484e14b934a9251410b96c65499f9603e2

Change History (2)

comment:1 Changed 11 years ago by timmywil

Component: unfiledattributes
Priority: undecidedlow
Resolution: duplicate
Status: newclosed
Version: git1.7.1

This is actually currently intended behavior. Before jQuery 1.7, .attr("value") would retrieve the value property. We've inserted the value attrHook for backwards compatibility reasons. The value property of an option is different in IE6/7 and jQuery cannot change that.


comment:2 Changed 11 years ago by timmywil

Duplicate of #9830.

Note: See TracTickets for help on using tickets.