title: Check if element has child node by id name
body: <p>I apologize if this is an easy question! I'm pretty new to javascript.</p>
  
  <p>I'm trying to check if a div has a specific child element (I'll name it 'child2'). I know about .hasChildNodes() but as far as I know it only lets you know if child nodes exist. I tried .contains like so:</p>
  
  <pre><code>if (parentDiv.contains(child2) == false) {
  </code></pre>
  
  <p>but even if the parentDiv <em>does</em> contain child2, it still returns false. It seems like such a simple thing to do and I've been trying to search around but I haven't had any luck in pure js. Thanks!</p>