title: The checkbox check if it is checked does not work
body: <p>I have a problem seeing if the checkbox has been checked.</p>
  <p>In particular, I have a table with id, name and country and an additional column with a checkbox. The purpose is to return all the ids of the checkbox that has been selected. But
  what I notice is that the if statement doesn't seem to work.</p>
  <p>Can you kindly help me?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function GetSelected() {
    var table = document.getElementById(mytable);
    var rowCount = table.rows.length;
    console.log(rowCount)
    for (var i = 1; i &lt; rowCount; i++) {
      var row = table.rows[i];
      var chkbox = table.getElementsByTagName("INPUT");
      if (chkbox[i].checked) {
        var row = checkBoxes[i].parentNode.parentNode;
        id_art += row.cells[0].innerHTML;
        console.log(id_art);
      }
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table cellspacing="0" rules="all" border="1" id="my-table" style="border-collapse: collapse;"&gt;
    &lt;tr&gt;
      &lt;th&gt;&amp;nbsp;&lt;/th&gt;
      &lt;th style="width:80px"&gt;Check&lt;/th&gt;
      &lt;th style="width:80px"&gt;Id&lt;/th&gt;
      &lt;th style="width:120px"&gt;Name&lt;/th&gt;
      &lt;th style="width:120px"&gt;Country&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;John Hammond&lt;/td&gt;
      &lt;td&gt;United States&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
      &lt;td&gt;2&lt;/td&gt;
      &lt;td&gt;Mudassar Khan&lt;/td&gt;
      &lt;td&gt;India&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
      &lt;td&gt;3&lt;/td&gt;
      &lt;td&gt;Suzanne Mathews&lt;/td&gt;
      &lt;td&gt;France&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;Robert Schidner&lt;/td&gt;
      &lt;td&gt;Russia&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;br /&gt;
  &lt;input type="button" value="Get Id Selected" onclick="GetSelected()" /&gt;</code></pre>
  </div>
  </div>
  </p>