Commit b85d2cd8 authored by timmywil's avatar timmywil

Simplify jQuery.removeAttr and return this

parent 9f88fa91
...@@ -325,14 +325,15 @@ jQuery.extend({ ...@@ -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 ) { removeAttr: function( elem, name ) {
name = jQuery.attrFix[ name ] || 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 ); name === "className" ? elem.className = "" : elem.setAttribute( name, null );
}
return this;
}, },
attrHooks: { attrHooks: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment