I have a button that runs an animation, the problem is that I can press the button quickly and the animation would restart, so I'm looking for a way to "Sleep" the button to prevent the animation from restarting.
I wonder if there is any method for that, I only find the "sleep()" method but it only serves me to sleep a function, so I think that none of them gives me a solution.
For what it's worth, the button type I used is HTML .
can be done with property
disabled
and eventanimationend
The HTML and styles:
The js file:
consider compatibility with older browsers: https://www.w3schools.com/jsref/event_animationend.asp