mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Make sure that the correct value is retreived for options that have no value specified, in IE 6. Continues to fix #5697.
This commit is contained in:
parent
f298cce100
commit
1b67aaee74
@ -164,7 +164,9 @@ jQuery.fn.extend({
|
||||
var values = jQuery.makeArray(val);
|
||||
|
||||
jQuery( "option", this ).each(function() {
|
||||
this.selected = jQuery.inArray( this.value, values ) >= 0;
|
||||
// IE 6 will return "" for the value if one isn't specified, instead of the text
|
||||
var node = this.getAttributeNode("value");
|
||||
this.selected = jQuery.inArray( node && node.specified ? node.value : this.value || this.text, values ) >= 0;
|
||||
});
|
||||
|
||||
if ( !values.length ) {
|
||||
|
Loading…
Reference in New Issue
Block a user