title: Dynamically Add a Delete Row jQuery DataTables
body: <p>I am trying to dynamically add a row to a table with an edit/delete column. When delete is clicked, I want to remove the clicked on row. </p>
  
  <p>I have initialized my table and the data in the following way:</p>
  
  <pre><code>            $('#myTable').dataTable();
  
  
              $("#myTableAddButton").click(function () {
                  var myVal1= $('#Val1').val();
                  var myVal2= $('#Val2').val();
                  var myVal3= $('#Val3').val();
  
  
                  $('#myTable').dataTable().fnAddData([
                      myVal1,
                      myVal2,
                      myVal3,
                      '&lt;a href="#" onclick="EditRow();return false;"&gt;Edit&lt;/a&gt; / &lt;a href="#" onclick="deleteRow();return false;"&gt;Delete&lt;/a&gt;'
                  ]);
  </code></pre>
  
  <p>Then my <code>DeleteRow()</code> function is simply:</p>
  
  <pre><code>function deleteContactRow() {
      //get the row of the cell that is clicked
      var $row = $(this).closest("tr");
      $row.delete();
  }
  </code></pre>
  
  <p>But it seems as though row.delete is not a valid function. Is there an alternative method to delete the row?</p>
  
  <p>EDIT: Both <code>$(this).remove()</code> and <code>$row.remove()</code> do not work</p>