JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.js"></script>
<div id="teste" />
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
</div>
<button title="Marcar" id="marcar"> Marcar </button>

JavaScript

var marcado = false;
$('#marcar').on("click", marcaChecks);

function marcaChecks(){
$('#teste').find('input[type=checkbox]').each(function(indice,elemento){
elemento.checked = !marcado;
});
marcado = !marcado;
}