X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fattributes.js;h=a76695b661d16c9aa4077182a3ead23544a17696;hb=2c4b20809e5d32e916c479c9b63a6b7528c880ce;hp=73dee368badc8c7962ce1f426dcd2de9d32d500d;hpb=700ff05af0d30722dcc23a69849bfb278fdc7e75;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index 73dee36..a76695b 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -163,8 +163,10 @@ jQuery.fn.extend({ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; - if ( option.selected ) { - // Get the specifc value for the option + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && !option.disabled && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + // Get the specific value for the option value = jQuery(option).val(); // We don't need an array for one selects