I want to find out if DOM element a contains DOM element b (that is, if a is an ancestor of b in the DOM tree). Thus, something like:
$(b).closest(a);
but where 'a' is a DOM node here, not a selector.
Can jQuery help with that? All the useful functions I can find take selector strings rather than elements, which doesn't really help if your DOM element is anonymous.