3 ms·
What's all this overengineering and waste creating timeouts? Why not just use setInterval? let interval = setInterval(() => document.querySelector('.main-
by eterm 2y ago
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
- hombre_fatal 2y agoHow could you be so wasteful traversing the DOM tree every time to find .main-btn? Shame on you.