by baapercollege · 2y ago · 0 comments
function clickTickedCheckboxes() { // Find all checked checkboxes const checkedBoxes = document.querySelectorAll('input[type="checkbox"]:checked');
// Iterate through each checked checkbox
checkedBoxes.forEach((checkbox, index) => {
// Use setTimeout to add a delay between clicks
setTimeout(() => {
// Click the checkbox
checkbox.click();
// If this is the last checkbox, call the function again after 2 seconds
if (index === checkedBoxes.length - 1) {
setTimeout(clickTickedCheckboxes, 2000);
}
}, index * 2000); // 2000ms (2 seconds) delay between each click
});
}// Start the process clickTickedCheckboxes();
No comments yet.