title: how to get value of checkbox in table in javascript
body: <p>I need to get the value of a checkbox provided with span in table rows. The code below is part of my project. The HTML code is for dynamic my table and javascript code is for getting the value of elements which does not work for the checkbox (it works for other input elements).</p>
  
  <p>my table:</p>
  
  <pre><code>var html = '&lt;tr class="rows" id="r'+row_id+'" style=""&gt;';
  html += '&lt;td&gt;&lt;input type="text" id = "abc" style="height:30px" class="rtl form-control" size="20" name="" /&gt;&lt;/td&gt;';
  html += '&lt;td&gt;&lt;input type="text" style="height:30px" class="rtl form-control" size="25" name="" /&gt;&lt;/td&gt;';
  html += '&lt;td style="text-align: center;"&gt;'+
  '&lt;label class="switch switch-label switch-pill switch-primary switch-sm" style="direction:ltr;"&gt;'+
  '&lt;input type="checkbox" value="1" data-size="mini" class="switch-input"&gt;'+
  '&lt;span class="switch-slider" data-checked="✓" data-unchecked="✕" unchecked&gt;&lt;/span&gt;&lt;/label&gt;'+
  '&lt;/td&gt;'+
  '&lt;td&gt;&lt;button class="btn btn-warning DT_action_minus" id="btn'+row_id+'" style="height:25px;width:25px;padding:0px;" href="#" title="delete"&gt;'+
  '&lt;i class="fa fa-minus" style="align:center" aria-hidden="true"&gt;&lt;/i&gt;&lt;/button&gt;&lt;/td&gt;'+
  '&lt;/tr&gt;';
  </code></pre>
  
  <p>getting the values:</p>
  
  <pre><code>var tbl = document.getElementById('descriptive-table');
  var rCount = tbl.rows.length;
  var cCount = 3;
  var allArray = [];
  for (var i = 1; i &lt;rCount; i++){
      var rowArray = [];
      for (var j = 0; j &lt;cCount; j++){                            
          rowArray.push(tbl.rows[i].cells[j].children[0].value);
      }
      allArray.push(rowArray);
  }
  console.log(allArray);
  </code></pre>