JSFiddle - React, Tailwind, and code Playground
HTML
<div class="chkHolder">
<input type="checkbox" class="chk" name="a" id="a" />
<input type="checkbox" class="chk" name="b" id="b" />
</div>
<a href="#">check all</a>
JavaScript
$('.chk').attr('change', function() {
alert('change event fired');
});
$('a').click(function() {
$('.chk').attr('checked', true).trigger('change');
});