X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=src%2Fattributes.js;h=ec4841bd3f4f27d271f01a5388e8fd39ca97e2e0;hp=cb9f2cf5e073e997d6c04a86e9400cfa8b4eedcc;hb=c7c067723006b0dfbb123c1a36885580a587d091;hpb=cf672a2e7a886cac5ae62f6772c6b4b43b19a2fc diff --git a/src/attributes.js b/src/attributes.js index cb9f2cf..ec4841b 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -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.