JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" name="paid" id="paid-change" value="1">
JavaScript
var getCheckBox = $("#paid-change")
function check() {
getCheckBox.prop('checked', true);
getCheckBox.val("1")
}
function uncheck() {
getCheckBox.prop('checked', false);
getCheckBox.val("0")
}
setInterval(function() {
switch (getCheckBox.val()) {
case "0":
check()
break;
case "1":
uncheck()
break;
}
}, 2000)