Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manually collect jQuery sequence? [duplicate]

I have two jQuery objects:

var one = $("#one");
var two = $("#two");

And I'm looking for a way to compile another jQuery object like:

var oneAndTwo = $(one, two); // pseudo-function

So I could work with it like as I get them with $("#one, #two").

Thanks.

like image 331
Plastic Rabbit Avatar asked Feb 17 '23 05:02

Plastic Rabbit


1 Answers

The solution is using add():

var oneAndTwo = one.add(two);
like image 97
VisioN Avatar answered Mar 06 '23 02:03

VisioN