title: How to remove an item from the array on button click
body: <p>I have a table with few rows and delete button. I have stored all the list of table in an array 'arr'. How can I remove the selected item from that array on button click.</p>
  
  <pre><code>&lt;table id="sum_table"&gt;
    &lt;tr class="titlerow"&gt;   
      &lt;th&gt;S.N.&lt;/th&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Action&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;John&lt;/td&gt;
      &lt;td&gt;&lt;button class="dm" data-id="0"&gt;Remove&lt;/button&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;2&lt;/td&gt;
      &lt;td&gt;Henry&lt;/td&gt;
      &lt;td&gt;&lt;button class="dm" data-id="1"&gt;Remove&lt;/button&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  
   var arr= [
    ["name", John],
    ["name", Henry]
    ];
  
    function clickHandler(clickEvent) {
  
  }
  
  document.addEventListener('DOMContentLoaded', function() {
    document.addEventListener('click', clickHandler);
  });
  </code></pre>