mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Simplify jQuery.removeAttr and return this
This commit is contained in:
parent
9f88fa9165
commit
b85d2cd8a5
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user