is there any way to make this work:
$(this, '#foo')
with that I want to select "this" element and #bar as well.
For selecting let's say two IDs, it is just as easy as '#foo, #bar'
, but when I want one of those two to be "this" I cannot get it to work.
$(this, '#foo')
The above line will search for this
inside an element with id
set to foo
, which isn't what you want here.
You can use add()
for this :
var $el = $(this).add('#foo')
Now $el
will contain $(this)
& $("#foo")
on which you can perform operations on.
add("selector")