title: How to select multiple checkbox in jquery datatable with pagination?
body: <p>I am using jquery datatables. There I am using check box for each row inside the table. Now I want when a user click select all link which is outside of table, will select all records in the table. For that I am using this function.</p>
  
  <pre><code>function checkAll(formname, checktoggle)
  {  
   var checkboxes = new Array(); 
   checkboxes = document[formname].getElementsByTagName('input');
   for (var i=0; i&lt;checkboxes.length; i++)  {
    if (checkboxes[i].type == 'checkbox')   {
      checkboxes[i].checked = checktoggle;
     }
   }
  
  }
  </code></pre>
  
  <p>Here select all link is</p>
  
  <pre><code> &lt;a onclick="javascript:checkAll('frm_charges', true);" href="javascript:void(0);"&gt;Select All&lt;/a&gt;
  </code></pre>
  
  <p>"frm_charges" is the name and id of the form.</p>
  
  <p>This is the code for check box, which I am using inside the table.</p>
  
  <pre><code>  &lt;input type="checkbox" value="742" name="charges[]" class="charges"  style="opacity: 0; position: absolute; z-index: -1; visibility: hidden;"&gt;
  </code></pre>
  
  <p>Now my problem is I have pagination it is selecting rows from first page but not all page.<img src="https://i.stack.imgur.com/6HGoE.png" alt="Screenshot"></p>