JSFiddle - React, Tailwind, and code Playground

by salitrapraveen

HTML

<div>
    <button id="ch">Click</button>
<input type="checkbox" value="A"/>
<input type="checkbox" value="B"/>
<input type="checkbox" value="C"/>
<input type="checkbox" value="D"/>
</div>

JavaScript

$(function() {

    var h = function() {
        var rez = $('input:checked').map(function() { return $(this).val(); }).get();
    return rez;
    }

        $('#ch').click(function(){
    console.log(h());
});
});