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++) {
    if ($('.checkbox > label > *').eq(n).is(':checked')) {
     list.push(this.value)
     console.log('checked');
     console.log(list);
     }
}
});