diff options
author | John Resig <jeresig@gmail.com> | 2007-01-20 03:58:57 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2007-01-20 03:58:57 +0000 |
commit | a87ecc44b6b4374ad2ebe10e033d45daab9e1369 (patch) | |
tree | d21c62554ce377993f9dd8a7e01570f6375377e5 | |
parent | 32f688d303ed3cbb942df421c5bb2ed7a5d5244c (diff) | |
download | jquery-a87ecc44b6b4374ad2ebe10e033d45daab9e1369.tar.gz jquery-a87ecc44b6b4374ad2ebe10e033d45daab9e1369.zip |
Added a fix for $("#noexist").attr("id") breaking.
-rw-r--r-- | src/jquery/jquery.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 085b576b9..4e82608f0 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -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; |