JSFiddle - React, Tailwind, and code Playground
by Yure Pereira
HTML
<form action="" id="my_form">
<label for="">
Blue<input type="checkbox" name="ck_color">
</label>
<label for="">
Red<input type="checkbox" name="ck_color">
</label>
<label for="">
Green<input type="checkbox" name="ck_color">
</label>
<label for="">
<input type="button" id="btn_check" value="Check">
</label>
</form>
JavaScript
$(function() {
var myForm = $('#my_form');
$('#btn_check').click(function() {
var checkboxs = myForm.find('input[name=ck_color]:checked');
console.log(checkboxs);
});
});