Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed issue with .add()ing individual elements - and with .add()ing f…
…orm elements (since they report a .length.
  • Loading branch information
jeresig committed Jan 20, 2007
1 parent 27c08b6 commit 7b3ab69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/jquery/jquery.js
Expand Up @@ -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] )
);
},

Expand Down

0 comments on commit 7b3ab69

Please sign in to comment.