JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" data="1" rel="module">
JavaScript
$('input[type="checkbox"]').on('click', function() {
var stateObj = {
id: $(this).attr("data"),
mode: $(this).attr("rel"),
state: null
}
if( $(this).prop('checked') === false ) {
stateObj.state = 1;
} else {
stateObj.state = 0;
}
updateState(stateObj);
});
function updateState(stateObj) {
console.log(stateObj.state);
}