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').prop('checked', true);
        $(this).text('Uncheck all')
    }, function() {
        $('.options input:checkbox').prop('checked', false);
        $(this).text('Check all');
    });
});