tedu.edu.vn| Select all checkboxes with jQuery
56 views

Select all checkboxes with jQuery

Select all checkboxes with jQuery

I need help with jQuery selectors. Say I have a markup as shown below:


 

How to get all checkboxes except #select_all when user clicks on it?
Any help will be appreciated.

Answer:

$('#select_all').click(function() {
    var c = this.checked;
    $(':checkbox').prop('checked',c);
});

Share with your friend!




© 2017 TEDU LEARNING AND ENTERTAINMENT

NGUYEN MINH HOANG  

01 LE LOI ST, WARD 1, MY THO CITY, TIEN GIANG PROVINCE
Email: minhhoangtgg@gmail.com | Mobile N0:
+84 1255 022 800|

Website: http://tedu.edu.vn