if (parentDiv.contains(child2) == false) {
var hasChild = parentDiv.querySelector("#child2") != null;