X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fattributes.js;h=e7e5d378da8b886a42a96db88250f1ff9a193a43;hb=d40083c866738727aa7ffd7f13d2955bc9575d5e;hp=90f3062ed29e76bb17dbf6c4a8bb59723e779268;hpb=148fb7ba8e992dd70c64cdc6a1c6f643fd1ba160;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index 90f3062..e7e5d37 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -232,13 +232,13 @@ jQuery.extend({ offset: true }, - attr: function( elem, name, value ) { + attr: function( elem, name, value, pass ) { // don't set attributes on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } - if ( name in jQuery.attrFn && value !== undefined ) { + if ( pass && name in jQuery.attrFn ) { return jQuery(elem)[name](value); }