$(document).ready(function() { $("#selectAll").click(function(){ if( $(this).prop("ch"> $(document).ready(function() { $("#selectAll").click(function(){ if( $(this).prop("ch">

Select all checkbox jQuery

  <th><input type="checkbox" id="selectAll"></th>
<input type="checkbox" class="id" >
<input type="checkbox" class="id" >
<input type="checkbox" class="id" >
<script>

$(document).ready(function() {
$("#selectAll").click(function(){

if( $(this).prop("checked")) {
              $(".id").prop("checked", false);
          } else {
              $(".id").prop("checked", true);
          }

});
});

  </script>


Leave a Reply