Hacker News new | past | comments | ask | show | jobs | submit login

What's all this overengineering and waste creating timeouts?

Why not just use setInterval?

    let interval = setInterval(() => document.querySelector('.main-btn').click(), 50) 
Then

    clearInterval(interval)
to stop



How could you be so wasteful traversing the DOM tree every time to find .main-btn? Shame on you.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: