var hasChild = parentDiv.querySelector("#child2") != null;
//The querySelector() method lets you search the subtree beneath the
//starting element using the given CSS selector string. If the element is found,
// its DOM node is returned.
const divElement = document.querySelector('div#rootElement');
document.body.contains(divElement); // return bool
if (element.hasChild(specificChild)) {
// do something
}