Skip to content

Commit

Permalink
Make sure that the correct value is retreived for options that have n…
Browse files Browse the repository at this point in the history
…o value specified, in IE 6. Continues to fix #5697.
  • Loading branch information
jeresig committed Dec 22, 2009
1 parent f298cce commit 1b67aae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/attributes.js
Expand Up @@ -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 ) {
Expand Down

0 comments on commit 1b67aae

Please sign in to comment.