Is there a jQuery function to select all DOM elements of a certain class that are outside the parent(s) of an element selected with $(this)
?
Thanks,
James
You can use .not()
to exclude the ancestors (gotten via .parents()
), like this:
$(".class").not($(this).parents())