I was experimenting with jQuery
and came across a question. Can I use an actual selector
with existing element
as a combined selector for
You could use the jQuery add method:
$('p').add($div).hover(function(e) { ...
If you have multiple elements to combine you don't wan to do
$('p').add($div1).add($div2).add($div3).add($div4).add($div5).add($div6) ...
Instead you want to convert a JavaScript array into a jQuery object
$( $.map([x,y,z], a => [...$.makeArray(a)]) )
Source: Merging jQuery objects