diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 0f1e0f5a8..28ba00702 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -34,7 +34,7 @@ test("get(Number)", function() { test("add(String|Element|Array)", function() { isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" ); - + isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" ); ok( $([]).add($("#form")[0].elements).length > 13, "Check elements from array" ); var x = $([]).add($("

xxx

")).add($("

xxx

")); diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index ca4051f3d..f756b67ab 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -985,7 +985,7 @@ jQuery.fn = jQuery.prototype = { add: function(t) { return this.pushStack( jQuery.merge( this.get(), - typeof t == "string" ? jQuery(t).get() : t ) + typeof t == "string" ? jQuery(t).get() : t.length ? t : [t] ) ); },