diff options
author | John Resig <jeresig@gmail.com> | 2007-01-20 04:16:25 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2007-01-20 04:16:25 +0000 |
commit | 7b3ab69fcfd5a53d7084bbe4b19a7f3e58d8564d (patch) | |
tree | b6d8ad0a67c92c29f5513a47b512fa88349cb32e /src | |
parent | 27c08b65446568b700606e837a85630d3634f25f (diff) | |
download | jquery-7b3ab69fcfd5a53d7084bbe4b19a7f3e58d8564d.tar.gz jquery-7b3ab69fcfd5a53d7084bbe4b19a7f3e58d8564d.zip |
Fixed issue with .add()ing individual elements - and with .add()ing form elements (since they report a .length.
Diffstat (limited to 'src')
-rw-r--r-- | src/jquery/jquery.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 4e82608f0..38c8da303 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -985,7 +985,10 @@ jQuery.fn = jQuery.prototype = { add: function(t) { return this.pushStack( jQuery.merge( this.get(), - typeof t == "string" ? jQuery(t).get() : t.length ? t : [t] ) + t.constructor == String ? + jQuery(t).get() : + t.length != undefined && !t.nodeName ? + t : [t] ) ); }, |