The main jQuery method takes a second optional argument to provide context for the search. eg
$(".setA", ancestorOfSetsA);
However, the jQuery add()
method does not accept this context argument. What I am trying to accomplish is:
$(".setA", ancestorOfSetsA).add(".setB", ancestorOfSetsB);
I am attempting this through a plugin that will overload the add()
method but I can't figure out how to combine two jQuery objects into one jQuery object.
I would like to find a way to do a scoped add()
with jQuery, but failing that, I'll write one myself if I can find a way to merge to jQuery objects.