JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/> 
<input type="checkbox"/> 
<input type="checkbox"/> 
<input type="button" onclick="checkAll()" value="CheckAll"

JavaScript

function checkAll(){
    var checkboxes = document.querySelectorAll('input[type=checkbox]');
    for(var i = 0, len = checkboxes.length; i<len; i++){
        checkboxes[i].checked = true;
    }
}

checkAll();