JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" name="paid" id="paid-change" value="1">

JavaScript

var checkbox = $("#paid-change");

function toggleCheckbox() {
    checkbox.prop('checked', function(i, checked) {
        return !checked;
    }).val(function(i, val) {
        return +this.checked;
    });
}

setInterval(toggleCheckbox, 2000);