JSFiddle - React, Tailwind, and code Playground
HTML
<div class="options">
<form>
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
</form>
<a href="#" class="check">Check all</a>
</div>
JavaScript
$(document).ready(function(){
$('.options a.check').toggle(function(){
$('.options input:checkbox').attr('checked','checked');
$(this).text('Uncheck all')
},function(){
$('.options input:checkbox').removeAttr('checked');
$(this).text('Check all');
});
});