jQuery selector editing HTML before adding to the DOM
<p>I am trying to add some content to the DOM using a jQuery selector but I want to manipulate it before it gets added.  </p>

<pre><code>var $content = $('&lt;h1&gt;title&lt;/h1&gt;&lt;h2 id="xx"&gt;remove me&lt;/h2&gt;&lt;p&gt;some content or other&lt;/p&gt;');

$content.remove('#xx');

$('#output').append($content);
</code></pre>

<p>I have put this on jsfiddle here <a href="http://jsfiddle.net/NNcG5/1/" rel="nofollow">http://jsfiddle.net/NNcG5/1/</a></p>

<p>Many thanks,
Mike</p>
