asp:checkbox check all checkboxes using jQuery


/ Published in: VB.NET
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // Checks all individual checkboxes
  2. $(".checkAreaAll").children("input").click(function () {
  3.  
  4. $(".checkArea").children("input").attr('checked', $(".checkAreaAll").children("input").is(':checked'));
  5.  
  6. });
  7.  
  8. // unchecks the check all checkbox when one individual checkbox is unchecked
  9. $(".checkArea").children("input").click(function () {
  10.  
  11. $(".checkAreaAll").children("input").attr('checked', false);
  12.  
  13. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.