The contains MethodThe contains method indicates whether an object contains another object (in terms of nested HTML elements), returning a value of true if so, and false otherwise . You can see the support for this method in Table 6.15. Table 6.15. The contains Method
Here's an example where I'm checking whether object1 contains element1 : var contained = object1.contains(element1) |