JSFiddle - React, Tailwind, and code Playground
HTML
<input type='checkbox' id='check-all' /> Check all
<br />
<input type='checkbox' class='options' value='1' /> Option 1
<input type='checkbox' class='options' value='2' /> Option 2
<input type='checkbox' class='options' value='3' /> Option 3
<input type='checkbox' class='options' value='4' /> Option 4
JavaScript
$(function(){
$('#check-all').change(function(){
$('.options').attr('checked',$(this).is(':checked'));
$('.options').trigger('change');
});
$('.options').change(function(){
alert($(this).val());
});
});