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.
The solution is using add()
:
var oneAndTwo = one.add(two);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With