Selecting multiple cached elements
Posted
by Globalz
on Stack Overflow
See other posts from Stack Overflow
or by Globalz
Published on 2010-05-11T03:28:55Z
Indexed on
2010/05/11
3:34 UTC
Read the original article
Hit count: 224
In jQuery you can select two elements by id like: $('#elem, #elem2');
BUT
What if you have cached the elem and elem2, and what to apply the same method/function to them both?
i.e.
$elem = $('#elem');
$elem2 = $('#elem2');
This obviously wont work:
$($elem, $elem2)
Thanks!
© Stack Overflow or respective owner