title: How to reference a set of checkboxes inside a table cell for any given row
body: <p>I have an HTML table with one cell per row that contains five checkboxes: </p>
  
  <pre><code>&lt;td class="days"&gt;
      &lt;label&gt;&lt;input type="checkbox" name="mon" id="mon" value="1" class="form-control" /&gt;M&lt;/label&gt;
      &lt;label&gt;&lt;input type="checkbox" name="tue" id="tue" value="2" class="form-control" /&gt;Tu&lt;/label&gt;
      &lt;label&gt;&lt;input type="checkbox" name="wed" id="wed" value="3" class="form-control" /&gt;W&lt;/label&gt;
      &lt;label&gt;&lt;input type="checkbox" name="thu" id="thu" value="4" class="form-control" /&gt;Th&lt;/label&gt;
      &lt;label&gt;&lt;input type="checkbox" name="fri" id="fri" value="5" class="form-control" /&gt;F&lt;/label&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>I need my javaScript to check the values of each checkbox to compare with something else. I have tried the following ways to get the value of the checkboxes mon, tue, wed, thu and fri but they don't seem to work:</p>
  
  <pre><code>var table = document.getElementById("leaveTable");
  var monValue = table.rows[row].cells[5].namedItem("mon").firstChild.value;
  </code></pre>
  
  <p>(the cell containing the checkboxes has an index of 5)</p>
  
  <p>I have multiple rows, all identical apart from the row index so that I can pass the row index as a parameter to my functions and the same functions will work irrespective of the row. </p>
  
  <p>I'm only using javaScript and not JQuery, so please only answer with javaScript suggestions. Thanks</p>