JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" name="test"><input type="checkbox" name="test">

JavaScript

var $checkboxes = $("input[type=checkbox][name=test]");

$checkboxes.on("click", function() {
    var checkedState = this.checked
    $checkboxes.each(function() {
        this.checked = checkedState;
    });
});