Skip to content

Commit

Permalink
Added a fix for $("#noexist").attr("id") breaking.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Jan 20, 2007
1 parent 32f688d commit a87ecc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jquery/jquery.js
Expand Up @@ -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;
Expand Down

0 comments on commit a87ecc4

Please sign in to comment.