Bug Tracker

Modify

Ticket #11345 (closed bug: duplicate)

Opened 15 months ago

Last modified 15 months ago

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:
Blocking: Blocked by:

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

Change History

comment:1 Changed 15 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to attributes
  • Version changed from git to 1.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.

 http://jsfiddle.net/timmywil/L2bWk/3/

comment:2 Changed 15 months ago by timmywil

Duplicate of #9830.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.