JSFiddle - React, Tailwind, and code Playground

by loktar

HTML

<form name='form'>
    <input type="checkbox" name="order_row_1"/>
    <input type="checkbox" name="order_row_2"/>
    <input type="checkbox" name="order_row_2"/>
    <input type="button" value="check all" id="checkall"/>
</form>

JavaScript

var checkAll = document.getElementById("checkall");

checkAll.onclick = function(){
    [].forEach.call(
        document.forms['form'].querySelectorAll("input[type='checkbox']"),
        function(el){
            el.checked=true;
    });
}