title: Pure javascript delete selected rows in html table
body: <p>I am trying to deleted selected or all rows using pure javascript. I am unable to delete selected rows. what was the issue in my <a href="https://jsfiddle.net/hfb6p45k/" rel="nofollow noreferrer">fiddle</a></p>
  
  <p>Edit: First row is header so not considering that.</p>
  
  <pre><code>document.getElementById("delete").addEventListener("click", function() {
    var tableRef = document.getElementById('links-list');
    var tableRows = document.getElementById("links-list").rows;
    var checkedIndexes = [];
    for (var i = 1; i &lt; tableRows.length; i++) {
      var checkboxSelected = tableRows[i] &amp;&amp; tableRows[i].cells[0].firstChild.checked;
      if (checkboxSelected) {
        checkedIndexes.push(i);
      }
    }
  
    for (var k = 0; k &lt; checkedIndexes.length; k++) {
      tableRef.deleteRow(checkedIndexes[k]);
    }
  });
  </code></pre>