title: How to count checkboxes has checked in DataTable for show and hidden Button
body: <p>I use datatable for data collection, I use the checkbox feature in the datatable to select the data that needs to be executed in the form of a delete and edit button, my plan to delete and edit buttons will appear together when the checkbox is selected in 1 data, for checkboxes selected more than 1 button will appear just delete it. I have a problem here that is the button does not want to appear, following my code</p>
  
  <p>Table and Button Code :</p>
  
  <pre><code>&lt;div class="col s12 m12 l12"&gt;
    &lt;button id="hapus" class="waves-effect waves-light btn" style="display: none"&gt;Hapus&lt;/button&gt;
    &lt;button id="status" class="waves-effect waves-light btn" style="display: none"&gt;Ubah Status&lt;/button&gt;
  
   &lt;table id="example" style="width:100%"&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th&gt;No&lt;/th&gt;
          &lt;th&gt;Judul&lt;/th&gt;
          &lt;th&gt;Tag&lt;/th&gt;
          &lt;th&gt;Status&lt;/th&gt;
          &lt;th&gt;Tanggal&lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
   &lt;/table&gt;
  </code></pre>
  
  <p></p>
  
  <p>Jquery:</p>
  
  <pre><code>$(document).ready(function(){
          var xx = document.getElementById("status");
          var xy = document.getElementById("hapus");
  
          var $checkboxes = $('#example td input[type="checkbox"]');
  
          $checkboxes.change(function(){
              var countCheckedCheckboxes = $checkboxes.filter(':checked').length;
  
              if (countCheckedCheckboxes == 1){
                  xx.style.display = "block";
                  xy.style.display = "block";
              } else if (countCheckedCheckboxes &gt;= 2) {
                  xx.style.display = "none";
                  xy.style.display = "block";
              } else {
                  xx.style.display = "none";
                  xy.style.display = "none";
              }
          }); 
      });
  </code></pre>