title: Error: Failed to execut 'removeChild' on 'Node'
body: <p>I'm new to javascript and programming in general.  I've put together my first browser game and while everything functions, I keep getting this pesky error in the console that says, "NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node" in my hover function.</p>
  
  <pre><code>function hover(myid) {
  var id = myid;
  var index = id[5];
  document.getElementById(id).removeChild(GAME.mound[index]);
  document.getElementById(id).appendChild(GAME.hover[index]);
  GAME.sound[0].play();
  }
  </code></pre>
  
  <p>Both GAME.mound and GAME.hover are arrays that store images. The thing I can't figure out is that I have a function that is nearly identical to reverse the image switch caused by the hover function, but it doesn't throw the error. </p>
  
  <pre><code>function out(myid) {
  var id = myid;
  var index = id[5];
  document.getElementById(id).removeChild(GAME.hover[index]);
  document.getElementById(id).appendChild(GAME.mound[index]);
  }
  </code></pre>
  
  <p>Here is a line from the HTML that calls the functions:</p>
  
  <pre><code>&lt;div id="drift0" class="snowdrift" onmouseover = "hover(this.id)" onmouseout = "out(this.id)" onclick = "popup(this.id)"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Any help in this is greatly appreciated.  Let me know if I didn't provide all the information needed to answer the question.</p>
  
  <p>Thanks!</p>