Attributes: return null when attribute does not exist

Fixes gh-2118
Close gh-2129
This commit is contained in:
Winston Howes
2015-03-16 11:20:16 -04:00
committed by Timmy Willison
parent 332fd941b4
commit aaeed53e9f
2 changed files with 39 additions and 44 deletions

View File

@@ -63,12 +63,7 @@ jQuery.extend({
return ret;
} else {
ret = jQuery.find.attr( elem, name );
// Non-existent attributes return null, we normalize to undefined
return ret == null ?
undefined :
ret;
return jQuery.find.attr( elem, name );
}
},