mirror of
https://github.com/jquery/jquery.git
synced 2026-01-25 08:28:08 -05:00
Added a fix for $("#noexist").attr("id") breaking.
This commit is contained in:
2
src/jquery/jquery.js
vendored
2
src/jquery/jquery.js
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user