tadam logo
Did you find an error in the text?
Select this with mouse and press
Ctrl + Enter
Xhtml.co.il Check Spelling
Orphus system

jQuery.contains()

jQuery.contains( container, contained )

Returns: Boolean
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?
   

Comments