title: javascript removechild
body: <p>I am trying to delete a hidden element. I have tried the following codes but it always returns the parent as undefined.</p>
  
  <p>attempt one</p>
  
  <pre><code>var timeLeft = document.getElementById("time");
  timeLeft.document.removeChild(timeLeft);
  </code></pre>
  
  <p>attempt two</p>
  
  <pre><code>var timeLeftBody, timeLeft;
  timeLeftBody = document.getElementsByTagName("body")[0];
  timeLeft = document.getElementById("time");
  timeLeft.timeLeftBody.removeChild(timeLeft);
  </code></pre>