X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fattributes.js;h=78b1bfd2029e34a7ddd26b43c8c1d13645ebdc86;hb=f28c774f2cde004a33aefc28306d995c599d963b;hp=f463b4afba70fa5992c19c2dce061a3a0de8f43d;hpb=b50f41a2e3ba9ab9a7bcf69a9633b0a8258015d6;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index f463b4a..78b1bfd 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -1,6 +1,6 @@ (function( jQuery ) { -var rclass = /[\n\t]/g, +var rclass = /[\n\t\r]/g, rspaces = /\s+/, rreturn = /\r/g, rspecialurl = /^(?:href|src|style)$/, @@ -272,8 +272,8 @@ jQuery.extend({ }, attr: function( elem, name, value, pass ) { - // don't set attributes on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2 ) { return undefined; }