Difference between remove() and detach() in jQuery
<p>I have a question related to jQuery <code>.remove()</code> method. Consider this code:</p>

<pre><code>var x;
$("#btn1").click(function() {
    x = $("p").remove();
});
$("#btn2").click(function() {
    $("body").prepend(x);
});
</code></pre>

<p>If the code is checked on click on the button2, the paragraph element is restored. 
I heard that <code>remove()</code> and <code>detach()</code> methods are different. How can they be different when <code>remove()</code> itself keeps all jQuery data?</p>
