Skip to main content

Bug Tracker

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:


open with ie6,ie7,ie8,ie9,chrome18,firefox10


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


ie67 : alert("")

others : alert(2)

proposed patch:

Attachments (0)
Change History (2)

Changed February 15, 2012 03:26PM UTC by timmywil comment:1

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.

Changed February 15, 2012 03:26PM UTC by timmywil comment:2

Duplicate of #9830.