jQuery append()/appendTo()/html() cause to fire javascript inside DOM
<p>I am working with some legacy software which generates HTML and I need to do some manipulation with this HTML. In order to do so I want to clone all body content to variable and work on it in order to not change anything in browser window. Like this:</p>

<pre><code>var tmp = jQuery("body").contents();
</code></pre>

<p>Then I try to do some modifications with <em>tmp</em> variable:</p>

<pre><code>tmp.wrap("&lt;span&gt;&lt;/span&gt;");
</code></pre>

<p>The problem is HTML has &lt;style&gt; and &lt;script&gt; tags in the &lt;body&gt; and it looks like JavaScript fires up when I try to append <em>tmp</em> somewhere, or do wrapping. I'd like to know if there is a way to do $.append, $.appendTo without firing javascript inside of it? (except, filtering actual HTML and removing all &lt;script&gt; tags)</p>
