title: How to insertBefore() element in body tag?
body: <p>I am trying to use insertBefore in js like this:</p>
  
  <pre><code>var p = document.createElement("p");
  p.innerHTML = "test1";
  document.body.insertBefore(p, null);
  
  var p = document.createElement("p");
  p.innerHTML = "test2";
  document.body.insertBefore(p, null);
  </code></pre>
  
  <p>But that would add the last p element just before the close of the body tag, how could I use it so it will be added to the top when it opens? So the last element added will be the first element inside the body tag.</p>
  
  <p>I tried:</p>
  
  <pre><code>document.body.insertBefore(p, document.getElementsByTagName('body')[0]);
  </code></pre>
  
  <p>But firebug shows:</p>
  
  <p><strong>Node was not found" code: "8</strong></p>