title: Elements outside <BODY> is taken inside <BODY>
body: <p>I have the following code:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script&gt;
          &lt;/script&gt;
  
          &lt;style&gt;
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id=div1 style="border:5px solid green" onClick="alert(this.id)"&gt;hi
              &lt;div id=div2 style="border:2px solid yellow"&gt;hello&lt;/div&gt;
              &lt;div id=div3 style="border:2px solid red"&gt;world&lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
      &lt;button onClick="document.body.appendChild(document.getElementById('div1').cloneNode(true));"&gt;cloneNode&lt;/button&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I wanted to make the clone of the <code>div1</code> to appear above the <code>cloneNode</code>button and hence kept the button outside the <code>&lt;body&gt;</code>. But each time I click on the <code>cloneNode</code>button the new element appears below the <code>cloneNode</code>button although I appended the new node to the <code>&lt;body&gt;</code>element(using <code>appendChild()</code>) and the button is outside the <code>&lt;body&gt;</code> element. So, are all the elements even those outside the <code>&lt;body&gt;</code>(<strong>as specified in the script</strong>) included or considered inside the <code>&lt;body&gt;</code> at runtime. Please help me understand this.</p>
  
  <p>Check the <a href="http://jsfiddle.net/t2K9U/" rel="nofollow"><strong>demo</strong></a></p>