JSFiddle - React, Tailwind, and code Playground
HTML
1<input type="checkbox" id="1" name="1"><br>
2<input type="checkbox" name="2"><br>
3<input type="checkbox" name="3"><br>
4<input type="checkbox" name="4"><br>
5<input type="checkbox" name="5"><br>
<p>Todas <input type="checkbox" id="all" name="all"/> </p>
JavaScript
//$(document).on('click', '#all', function (e) {
// $('input[type="checkbox"]').not('#all').each(function() {
// var checked = $(this).is(':checked');
// checked ? $(this).prop('checked', false) : $(this).prop('checked', true);
// });
//});
document.getElementById("all").addEventListener("click", function(){
checkBoxs = document.querySelectorAll('input[type="checkbox"]:not([id=all])');
//"Hack": http://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/
[].forEach.call(checkBoxs, function(checkbox) {
checkbox.checked = checkbox.checked ? false : true;
});
});