Select All Checkboxes with jQuery
Jack Harner 🚀
Posted on April 26, 2019
A quick little jQuery snippet in order to select all checkboxes in a list of checkboxes.
$("#selectAll").click(function(){
$("input[type=checkbox]").prop('checked', $(this).prop('checked'));
});
Basically, on Click of the Select All checkbox, set all checkboxes' checked
property to the value of the Select All checkbox's checked
property. That way you can select or deselect all.
💖 💪 🙅 🚩
Jack Harner 🚀
Posted on April 26, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.