X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fattributes.js;h=ec4841bd3f4f27d271f01a5388e8fd39ca97e2e0;hb=0cdcef5b364fa3c89d7f27935e77b453f4a56efd;hp=cb9f2cf5e073e997d6c04a86e9400cfa8b4eedcc;hpb=d558e9eb6f44783bb06666617c758408daf53e3d;p=jquery.git 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.