diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-03-13 16:17:13 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-04-03 19:13:39 -0400 |
commit | b85d2cd8a5c49487dc3ea7f6fad963efd9fd0f55 (patch) | |
tree | e7bd38fbd082f06fb53d8c09e9d62c65425110be /src/attributes.js | |
parent | 9f88fa9165e73b879d0c955fdf81fdd681d2d192 (diff) | |
download | jquery-b85d2cd8a5c49487dc3ea7f6fad963efd9fd0f55.tar.gz jquery-b85d2cd8a5c49487dc3ea7f6fad963efd9fd0f55.zip |
Simplify jQuery.removeAttr and return this
Diffstat (limited to 'src/attributes.js')
-rw-r--r-- | src/attributes.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/attributes.js b/src/attributes.js index 64b612617..c19b82923 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: { |