diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2015-03-30 15:32:54 -0400 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2015-03-30 15:32:54 -0400 |
commit | 2905961bf75b741937f430ee5b619f11e93a448d (patch) | |
tree | 6c7b7e5f544f8d0fe6fa143ec8a526cbc256c062 /src/attributes/attr.js | |
parent | 7b09235ceed57bbcc26fc2c76147eb4e95ebdb92 (diff) | |
download | jquery-2905961bf75b741937f430ee5b619f11e93a448d.tar.gz jquery-2905961bf75b741937f430ee5b619f11e93a448d.zip |
Attributes: revert returning null for non-existant attributes
Ref https://github.com/jquery/jquery/issues/2118
Diffstat (limited to 'src/attributes/attr.js')
-rw-r--r-- | src/attributes/attr.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/attributes/attr.js b/src/attributes/attr.js index 3bb05a5a3..caf0bc018 100644 --- a/src/attributes/attr.js +++ b/src/attributes/attr.js @@ -63,7 +63,12 @@ jQuery.extend({ return ret; } else { - return jQuery.find.attr( elem, name ); + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? + undefined : + ret; } }, |