I have this button that, when it loads, I set it to "animated flash" as a class to make the animation "flash" of animate.css. The problem I have is to put the class back to it by clicking the button, which does not catch the animation. Any way to solve this?
var elemento = document.getElementsByTagName("button")
elemento[0].setAttribute("class","animated flash")
function handleOnClick(e) {
console.log("button clicked");
const button = e.target;
button.setAttribute("class", "animated flash");
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<button onclick="handleOnClick(event)"> myAnimatedButton </button>