Commit 1b67aaee authored by jeresig's avatar jeresig

Make sure that the correct value is retreived for options that have no value...

Make sure that the correct value is retreived for options that have no value specified, in IE 6. Continues to fix #5697.
parent f298cce1
...@@ -164,7 +164,9 @@ jQuery.fn.extend({ ...@@ -164,7 +164,9 @@ jQuery.fn.extend({
var values = jQuery.makeArray(val); var values = jQuery.makeArray(val);
jQuery( "option", this ).each(function() { 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 ) { if ( !values.length ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment