Removing top-level items from a jQuery set
<p>I can't find a way to remove top-level items from a jQuery set. Here is my attempt:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script&gt;
        $(function() {
            var data = '&lt;div id="node_1"&gt;aa&lt;/div&gt; &lt;div id="node_2"&gt;bb&lt;/div&gt; &lt;div id="node_3"&gt;cc&lt;/div&gt;';
            var nodes = $(data);
            nodes.remove("#node_2");
            $("#container").append(nodes);
        });
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div id="container"&gt; &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I expected the following in the container:</p>

<pre><code>&lt;div id="container"&gt;
    &lt;div id="node_1"&gt;aa&lt;/div&gt;
    &lt;div id="node_3"&gt;cc&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>But the node #2 is not removed.</p>

<p>How can I remove node #2 <strong>before</strong> inserting it into the document ?</p>
