How to get a count of checkboxes checked on pagination Jquery dataTables
<p>Below is my code, I want to get the count of checked checkboxes of all pages in my DataTable. Please advice how to proceed</p>

<pre><code> &lt;td align="center"&gt;&lt;input type="checkbox" align="center" id="all" class="groupCheckBox" name="emails[]" value=' . $user['id'] . '&gt;&lt;/td&gt;
</code></pre>

<p>Below code I used for get the values of checked boxes in all pages on button click</p>

<pre><code> $('#merge_button').click(function () {   
         var id = ""; 
         var oTable = $("#userTable").dataTable(); 
         $(".groupCheckBox:checked", oTable.fnGetNodes()).each(function () { 

             if (id != "") { 
                 id = id + "," + $(this).val(); 
             } else { 
                 id = $(this).val(); 
             } 

             document.getElementById("email").value = id; 
         }); 
    }); 
</code></pre>

<p>but now I want to count the checkedboxes without button click function whenever user clicked on checkboxes and deduct count when unchecking boxes . pls advice</p>