Fix attr() problems in IE with attribute nodes. Followup to commit b50f41a2.
[jquery.git] / src / attributes.js
index b0e3601..78b1bfd 100644 (file)
@@ -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;
                }