diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-03-24 00:42:00 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-04-03 19:13:39 -0400 |
commit | 11cfdb23940b2c76e1104c82afc9552ac6f3dc19 (patch) | |
tree | 010faf267c166df7d7d5c0d9676e644a4a865dac /src/attributes.js | |
parent | dfeeb872d611c7ff7270fceb7234dd0e04671eb8 (diff) | |
download | jquery-11cfdb23940b2c76e1104c82afc9552ac6f3dc19.tar.gz jquery-11cfdb23940b2c76e1104c82afc9552ac6f3dc19.zip |
Non-existent attribute for jQuery.attr no longer needs to check for "undefined"
- Remove an unnecessary var
- Use variable in removeAttr for better minification
Diffstat (limited to 'src/attributes.js')
-rw-r--r-- | src/attributes.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/attributes.js b/src/attributes.js index 55d22eb94..dc9a333bb 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -317,12 +317,12 @@ jQuery.extend({ return ret; } else { - var attr = elem.getAttribute( name ); + ret = elem.getAttribute( name ); // Non-existent attributes return null, we normalize to undefined - return attr === null || attr === "undefined" || attr === "null" ? + return ret === null || ret === "null" ? undefined : - attr; + ret; } } }, @@ -336,7 +336,7 @@ jQuery.extend({ // set property to null if getSetAttribute not supported (IE6-7) // setting className to null makes the class "null" if ( name === "className" ) { - elem.className = ""; + elem[ name ] = ""; } else { elem.setAttribute( name, null ); } |