Commit 7b3ab69f authored by John Resig's avatar John Resig

Fixed issue with .add()ing individual elements - and with .add()ing form...

Fixed issue with .add()ing individual elements - and with .add()ing form elements (since they report a .length.
parent 27c08b65
......@@ -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] )
);
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment