Skip to content
Permalink
Browse files

Simplify jQuery.removeAttr and return this

  • Loading branch information
timmywil
timmywil committed Mar 13, 2011
1 parent 9f88fa9 commit b85d2cd8a5c49487dc3ea7f6fad963efd9fd0f55
Showing with 6 additions and 5 deletions.
  1. +6 −5 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: {

0 comments on commit b85d2cd

Please sign in to comment.
You can’t perform that action at this time.