OK, going rond in circles again – I’m sure the answer will be obvious. Just not to me 🙂
I can’t seem to specify this as one target amongst a few targets for a function:
$(this, "elem1, elem2").doStuff()
I just want to doStuff() to a pair of elements, one of which is this. I can only get it to work if I explicitly name the elements, ie…
$("elem1, elem2, elem3").doStuff()
…works fine. But I can’t seem to get it to work if I want to include this in the list. I have to write one line just for this, and another for elem1 elem2 etc.
All help greatly appreciated. Thanks.
If I understand you correctly, you can use
add()to addthisto the jQuery object:Or in reverse:
or even: