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.attr('checked',true);
getCheckBox.val("1")
}
function uncheck(){
getCheckBox.attr('checked',false);
getCheckBox.val("0")
}
setInterval(function(){
switch (getCheckBox.val()){
case "0":
check()
break;
case "1":
uncheck()
break;
}
},2000)