X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fattributes.js;h=ec4841bd3f4f27d271f01a5388e8fd39ca97e2e0;hb=543db64412b37b5fa1f3d7fea19f62d6db993fb0;hp=dd6a3e7abe641b387aaa0077bdc30387373acb7d;hpb=97d468fbf0f840f52c91855b0bc8db0ed6ac403c;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index dd6a3e7..ec4841b 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -164,7 +164,7 @@ jQuery.fn.extend({ var option = options[ i ]; // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { // Get the specific value for the option @@ -295,7 +295,14 @@ jQuery.extend({ jQuery.error( "type property can't be changed" ); } - elem[ name ] = value; + if ( value === null ) { + if ( elem.nodeType === 1 ) { + elem.removeAttribute( name ); + } + + } else { + elem[ name ] = value; + } } // browsers index elements by id/name on forms, give priority to attributes.