jquery this and other elements
Posted
by odavy
on Stack Overflow
See other posts from Stack Overflow
or by odavy
Published on 2010-04-16T09:09:34Z
Indexed on
2010/04/16
9:13 UTC
Read the original article
Hit count: 109
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.
© Stack Overflow or respective owner