I am working with checkboxes that need to trigger code every second. The code is inside a timer, within an "if" statement that checks if the checkbox is checked. When the checkbox is checked, it should refresh an iframe to display updated content from a website. Each checkbox is associated with a different timer to reset the iframe. However, there seems to be an issue preventing the execution of the code. See below for the code snippet:
if (document.getElementById("1").checked == true) {
setTimeout(function () {
f.src = f.src;
}, 100);
}
if (document.getElementById("2").checked == true) {
setTimeout(function () {
f.src = f.src;
}, 5000);
}