Using the before function in JQuery
<p>I'm learning jQuery and having a problem with the <code>before</code> function. What I'm doing is I have table with a class of <code>fish</code> and using <code>detach</code> to remove it and put it into an array so that when I hit a button it will restore it back to its original place. Here is what I have below. The end result im trying to accomplish is putting text(Pan-Fried Halibut) back into the table. Any help with be very much appreciated</p>

<pre><code>&lt;table&gt;
    &lt;tr&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
        &lt;td class="fish"&gt;Pan-Fried Halibut&lt;/td&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Here is the jQuery detach function:</p>

<pre><code>$("input#btn1").click(function () {
    $f = $(".fish").detach();
});
</code></pre>

<p>Trying to put the text back in:  </p>

<pre><code>$("input#btn2").click(function () { 
    $(".fish").first().before($f);  'This statement doesnt work; what am i doing wrong
});                            
</code></pre>
