Checkbox implementation for all checkboxes


I am trying to implement a checkbox to select all chekboxes with one click here.
Unfortunately, I couldn’t achieve it. Can an jquery expert help me, please? The individual checkoxes work fine, but the “SelectAll” checkbox for all tables at the top doesn’t work. Thanks.



thanks, astonecipher. Your code selects all, but doesn’t highlight the tables. isn’t it supposed to highlight at the same time?


That wasn’t mentioned. For that to happen, you just need to trigger the event that the other functions use to toggle the class,

$('input:checkbox').not(this).prop('checked', this.checked) .trigger("change");
Rather than just the property change.


I am sorry, it is my ignorance, I just assume that if it’s checked, it should highlight automatically. thanks a lot, I will check your code, and implement it on my page.