Side navigation
#11345 closed bug (duplicate)
Opened February 15, 2012 10:24AM UTC
Closed February 15, 2012 03:26PM UTC
Last modified February 15, 2012 03:26PM UTC
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: |
Description
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
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.
http://jsfiddle.net/timmywil/L2bWk/3/