Added a fix for $("#noexist").attr("id") breaking.

This commit is contained in:
John Resig 2007-01-20 03:58:57 +00:00
parent 32f688d303
commit a87ecc44b6

View file

@ -429,7 +429,7 @@ jQuery.fn = jQuery.prototype = {
// Look for the case where we're accessing a style value
if ( key.constructor == String )
if ( value == undefined )
return jQuery[ type || "attr" ]( this[0], key );
return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
else {
obj = {};
obj[ key ] = value;