Commit 11cfdb23 authored by timmywil's avatar timmywil

Non-existent attribute for jQuery.attr no longer needs to check for "undefined"

- Remove an unnecessary var

- Use variable in removeAttr for better minification
parent dfeeb872
...@@ -317,12 +317,12 @@ jQuery.extend({ ...@@ -317,12 +317,12 @@ jQuery.extend({
return ret; return ret;
} else { } else {
var attr = elem.getAttribute( name ); ret = elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined // Non-existent attributes return null, we normalize to undefined
return attr === null || attr === "undefined" || attr === "null" ? return ret === null || ret === "null" ?
undefined : undefined :
attr; ret;
} }
} }
}, },
...@@ -336,7 +336,7 @@ jQuery.extend({ ...@@ -336,7 +336,7 @@ jQuery.extend({
// set property to null if getSetAttribute not supported (IE6-7) // set property to null if getSetAttribute not supported (IE6-7)
// setting className to null makes the class "null" // setting className to null makes the class "null"
if ( name === "className" ) { if ( name === "className" ) {
elem.className = ""; elem[ name ] = "";
} else { } else {
elem.setAttribute( name, null ); elem.setAttribute( name, null );
} }
......
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