JSFiddle - React, Tailwind, and code Playground

by Felipe Kautzmann

HTML

<button type="button" id='check_all'>Check All</button>
</br>

<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
<input type="checkbox" name="vehicle" value="Car">I have a car 
<input type="checkbox" name="vehicle" value="Motorbike">I have a Motorbike

JavaScript

$('#check_all').click(function() {
    $('input[name=vehicle]').prop('checked', true);
});

$('#check_all').click(function() {
    $('input[name=vehicle]').prop('checked', false);
});