JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<div id="container">
  <input type="checkbox">
  <input type="checkbox">
  <input type="checkbox">
  <input type="checkbox">
</div>
<button type="button" id="addAll">add all</button>
<button type="button" id="removeAll">remove all</button>

JavaScript

$("#addAll").click(function() {
      $("#container input:checkbox").attr('checked', 'checked');
    });
    $("#removeAll").click(function() {
      $("#container input:checkbox").removeAttr('checked');
    });