Jumat, 20 Januari 2017

Check All Checkbox Jquery

To check or uncheck all checkbox we can using this simple script
$('#cek_all').click(function (event) {  //on click
if (this.checked) { // check select status
$('.checkboxs').each(function () { //loop through each checkbox
this.checked = true; //select all checkboxes with class "checkboxs"            
});
} else {
$('.checkboxs').each(function () { //loop through each checkbox
this.checked = false; //deselect all checkboxes with class "checkboxs"                    
});
}
});
Glad can share☺

Tidak ada komentar:

Posting Komentar