We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f298cce commit 1b67aaeCopy full SHA for 1b67aae
src/attributes.js
@@ -164,7 +164,9 @@ jQuery.fn.extend({
164
var values = jQuery.makeArray(val);
165
166
jQuery( "option", this ).each(function() {
167
- this.selected = jQuery.inArray( this.value, values ) >= 0;
+ // 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;
170
});
171
172
if ( !values.length ) {
0 commit comments