From b85d2cd8a5c49487dc3ea7f6fad963efd9fd0f55 Mon Sep 17 00:00:00 2001 From: timmywil Date: Sun, 13 Mar 2011 16:17:13 -0400 Subject: [PATCH] Simplify jQuery.removeAttr and return this --- src/attributes.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/attributes.js b/src/attributes.js index 64b61261..c19b8292 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -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: {