JSFiddle - React, Tailwind, and code Playground
HTML
<div class="checkbox checkbox-inline">
<label>
<input type="checkbox" id="space" value=" ">Spacja
</label>
<label>
<input type="checkbox" id="comma" value=",">Przecinek
</label>
<label>
<input type="checkbox" id="dot" value="." checked>Kropka
</label>
</div>
JavaScript
var list = [];
$(document).ready(function () {
for (var n = 0; n < 4; n++) {
var checkbox = $('.checkbox > label > *').eq(n);
if ((checkbox).is(':checked')) {
list.push(checkbox.value);
console.log('checked');
console.log(list);
}}
});