How to dump DOM into a variable and detach it from document (jQuery)
<p>I need to do this:</p>

<pre><code>var tempDoc;
$(tempDoc).load('&lt;html&gt;' + $(document).find('html').html() + '&lt;/html&gt;');
</code></pre>

<p>and then do this:</p>

<pre><code>$('body', tempDoc).css('background-color', '');
</code></pre>

<p>However when I do this, background-color removal also affects the $(document).
Is there a way to dump the $(document) into a temporary variable and change elements in it without affecting the $(document) itself? </p>

<p>Please let me know if this even make sense.</p>
