title: JQuery table/button delete
body: <p>I have a table with 4 columns where one of these columns has a button. I wish that when the button receives a click the table row where the button is to be excluded.</p>
  
  <p>Since the table rows are inserted dynamically on click of another button, with this the ID's of the buttons are dynamic which prevents me from using the ID of the button that is on the table as a selector.</p>
  
  <p>Then I would do the following: On the button click I want to find out which row of the table is the button, and then delete this line.</p>
  
  <p>Any suggestions?</p>
  
  <p>Below the table that I am manipulating.</p>
  
  <pre><code>&lt;table id="tbIngredients"&gt;
       &lt;thead&gt;
            &lt;tr&gt;
                &lt;th id="cod"&gt; Code &lt;/ th&gt;
                &lt;th id="desc"&gt; Description &lt;/ th&gt;
                &lt;th id="price"&gt; Price &lt;/ th&gt;
                &lt;th id="op"&gt; Operation &lt;/ th&gt;
            &lt;/ tr&gt;
       &lt;/ thead&gt;
       &lt;tbody&gt;
            &lt;tr&gt;
               &lt;td id="tr1"&gt; 1 &lt;/ td&gt;
               &lt;td&gt; Ingredient &lt;/ td&gt;
               &lt;td&gt; $ 1.00 &lt;/ td&gt;
               &lt;td id="td1"&gt; &lt;input type="button" class="delIngredient" value="Excluir     ingrediente"&gt; &lt;/ td&gt;
           &lt;/ tr&gt;
           &lt;tr id="tr16"&gt;
               &lt;td&gt; 16 &lt;/ td&gt;
               &lt;td&gt; Papaya &lt;/ td&gt;
               &lt;td&gt; £ 01.05 &lt;/ td&gt;
               &lt;td id="td16"&gt; &lt;input type="button" class="delIngredient" value="Excluir ingrediente"&gt; &lt;/ td&gt;
           &lt;/ tr&gt;
       &lt;/ tbody&gt;
  &lt;/ table&gt;    
  </code></pre>