Is there a way to create a checkbox that triggers a timing event when checked, and then stops the event when unchecked? Currently, it seems like the function continues even after unchecking the box, causing the variable to increment at a faster rate.
Check out the JS Code below:
var money = 0;
function moneyMaker(){
money++;
document.getElementById('money').innerHTML = money;
}
function doautoMoney(){
window.setInterval(function(){
moneyMaker();
document.form.automoney.click();
//alert('Auto Saved!');
}, 1000);
}