Javascript: Remove Child when using document.write
<p>I want to have something like this:</p>

<pre><code>var abc1 = document.write('&lt;html&gt;HTMLPAGECONTENTHERE&lt;/html&gt;');

function removepage(){
abc1.parentNode.removeChild(abc1);
}

removepage();
</code></pre>
