How to remove an element from jQuery object?
<p>Code:</p>

<pre><code>&lt;div id="d1"&gt;d1&lt;/div&gt;
&lt;div id="d2"&gt;d2&lt;/div&gt;
&lt;script&gt;
$(function(){
    var j=$();
    j=j.add("#d1");
    j=j.add("#d2");

    j.remove("#d1");//not this...
    //alert(j.length);
    j.css("border","1px solid red");
});
&lt;/script&gt;
</code></pre>

<p>I've used <code>j.add()</code> to add elements to <code>j</code>, but how do I remove <code>#d1</code> from <code>j</code>?</p>

<p><code>j.remove()</code> is not working, because it removes the <code>#d1</code> and <code>j.length</code> still be 2.</p>

<p>Thanks all! :)</p>
