Description: Check to see if a DOM node is within another DOM node.
Arguments
jQuery.contains( container, contained )
version added: 1.4
container
The DOM element that may contain the other element.
contained
Node
The DOM node that may be contained by the other element.
Example
Check if an element is inside another.jQuery.contains(document.documentElement, document.body); // true jQuery.contains(document.body, document.documentElement); // false
Was this information helpful?

