Add div to another div, then make some actions and then remove added div. How?
<pre><code>$div = $('&lt;div&gt;Here is my div!&lt;/div&gt;');
$('#bar').append($div.html());
//do some actions
$div.remove();
</code></pre>

<p>But appended div isn't removed?</p>

<p>How can I do it?</p>
