I think you are trying to merge the jQuery array of items found by
".stuff" and ".morestuff"

var $obj1 = $(".stuff");
var $obj2 = $(".morestuff");
$obj1.add($obj2);
alert($obj1.length);

the problem is the line

$obj1.add($obj2);

doesn't assign the value back to variable "$obj1", so the next line
had no idea that $obj1 was changed

this would

var $obj1 = $(".stuff");
var $obj2 = $(".morestuff");
$obj1 = $obj1.add($obj2);
alert($obj1.length);

as shown here:
http://jsbin.com/akuto/edit


Reply via email to