Example 2


Code


<script>
$(document).ready(function(){
  var checkboxes = $(':checkbox');
  var buttonAll = $('#checkAll');
  var buttonNone = $('#checkNone');
  
  buttonAll.on('click', function(){
    checkboxes.prop('checked', true);
  });
  
  buttonNone.on('click', function(){
    checkboxes.prop('checked', false);
  });
});
</script>
           

Go Back