]> source.dussan.org Git - jquery.git/commitdiff
Simplify jQuery.removeAttr and return this
authortimmywil <tim.willison@thisismedium.com>
Sun, 13 Mar 2011 20:17:13 +0000 (16:17 -0400)
committertimmywil <tim.willison@thisismedium.com>
Sun, 3 Apr 2011 23:13:39 +0000 (19:13 -0400)
src/attributes.js

index 64b6126175e5fd93dcd483f6b03e739c627822a0..c19b82923447946d08dcf6a8e85be0f50574eed8 100644 (file)
@@ -325,14 +325,15 @@ jQuery.extend({
                }
        },
        
-       // removeAttribute returns boolean in IE
-       // set property to null if getSetAttribute not supported (IE6-7)
        removeAttr: function( elem, name ) {
                name = jQuery.attrFix[ name ] || name;
-               if ( typeof elem.removeAttribute( name ) === "boolean" && !jQuery.support.getSetAttribute ) {
-                       // Setting className to null sets a class of "null"
+               
+               jQuery.support.getSetAttribute ? elem.removeAttribute( name ) :
+                       // set property to null if getSetAttribute not supported (IE6-7)
+                       // setting className to null makes the class "null"
                        name === "className" ? elem.className = "" : elem.setAttribute( name, null );
-               }
+
+               return this;
        },
 
        attrHooks: {