ok( $("div").get(0) == document.getElementById("main"), "Get A Single Element" );\r
});\r
\r
+test("add(String|Element|Array)", function() {\r
+ isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );\r
+ \r
+ ok( $([]).add($("#form")[0].elements).length > 13, "Check elements from array" );\r
+ \r
+ var x = $([]).add($("<p id='x1'>xxx</p>")).add($("<p id='x2'>xxx</p>"));\r
+ ok( x[0].id == "x1", "Check on-the-fly element1" );\r
+ ok( x[1].id == "x2", "Check on-the-fly element2" );\r
+});\r
+\r
test("each(Function)", function() {\r
expect(1);\r
var div = $("div");\r
*/
add: function(t) {
return this.set( jQuery.merge(
- this.get(), typeof t == "string" ?
- jQuery.find(t) :
- t.constructor == Array ? t : [t] ) );
+ this.get(),
+ typeof t == "string" ? jQuery.find(t) : t )
+ );
},
/**