After adding, resetting/removing table rows in jQuery
<pre><code>&lt;table id="myTable" style="width: 650px;"&gt;
  &lt;tbody&gt;
    &lt;tr style="font-weight: bold;"&gt;
        &lt;td&gt;Name&lt;/td&gt;
        &lt;td&gt;Price&lt;/td&gt;
        &lt;td&gt;Supplier&lt;/td&gt;
        &lt;td&gt;Amount&lt;/td&gt;
        &lt;td&gt;Basket&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>is my HTML.</p>

<p>This is my current jQuery JS:</p>

<pre><code>    $.post('/ajax/products', { method: 'search', string: searchstring, category: $('#search_category').val() }, function(data) {
        data = $.parseJSON(data);
            $('#myTable &gt; tbody:last').append('&lt;tr&gt;&lt;td&gt;'+b.name+'&lt;/td&gt;&lt;td&gt;'+b.price+'&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;');
        });
    });
</code></pre>

<p>Each time you key up, the above js executes. Now when you are looking for Cookies, and you starts to write, it sends a ajax post with "C" then "Co" then "Coo" etc. </p>

<p>Already at the first ajax call it has found results that are starting with C. Therefore it appends to the table. Now it also found results for "Co" (same results as "C", because theres only Cookies in the db at the moment). </p>

<p>And the same with Coo, Cook, Cooki, Cookie, Cookies... yeah you get the point. And the results of this is alot of tables appending under eachother.</p>

<p>So what i wish to do is like cleaning/removing the <code>&lt;tr&gt;</code>'s thats inside <code>#myTables</code> tbody, before it appends (actually just before the $.post()). </p>

<p>But it should not remove the first <code>&lt;tr&gt;</code>, which is the column headers as you can see in my above html.</p>

<p>How can i do this?</p>
