If I had two jQuery result sets, say
$("#someParent *")
and
$("#someElement").nextAll()
then how could I best get all the elements that occur in both result sets?
You can use filter():
var firstSet = $("#someParent *");
var secondSet = $("#someElement").nextAll();
var elementsInBothSets = firstSet.filter(secondSet);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With