title: On button click delete a row after delete will add a new row on the same spot jquery
body: <p>In layman's term i want to replace a certain row on button click.</p>
  
  <p>i tried</p>
  
  <pre><code>$(document).on('click', '#removerow', function() {
      var addedRows = [];
      $("#tableid").find("tr").remove();
      var $row = $("&lt;tr class=''&gt;&lt;td class='tdlabel'&gt; &lt;span&gt;New Row &lt;/td&gt;&lt;/tr&gt;");
      addedRows.push($row);
      $("table#tableid tr").last().before($row);
  });
  </code></pre>
  
  <p>It just remove the rows in the table but did not add the rows that added. </p>