Skip to content

Commit 1b67aae

Browse files
committed
Make sure that the correct value is retreived for options that have no value specified, in IE 6. Continues to fix #5697.
1 parent f298cce commit 1b67aae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/attributes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ jQuery.fn.extend({
164164
var values = jQuery.makeArray(val);
165165

166166
jQuery( "option", this ).each(function() {
167-
this.selected = jQuery.inArray( this.value, values ) >= 0;
167+
// IE 6 will return "" for the value if one isn't specified, instead of the text
168+
var node = this.getAttributeNode("value");
169+
this.selected = jQuery.inArray( node && node.specified ? node.value : this.value || this.text, values ) >= 0;
168170
});
169171

170172
if ( !values.length ) {

0 commit comments

Comments
 (0)