Untitled

mail@pastecode.io avatar
unknown
javascript
5 days ago
471 B
5
Indexable
Never
const selector = '#nextButton';
const interval = 5000; // 5s
function checkAndClickButton() {
    const button = document.querySelector(selector);

    if (button) {
        if (!button.disabled) {
            console.log('Button is enabled, clicking it...');
            button.click();
        } else {
            console.log('Button is disabled.');
        }
    } else {
        console.log('Button not found.');
    }
}

setInterval(checkAndClickButton, interval);
Leave a Comment