JSFiddle - React, Tailwind, and code Playground
HTML
<button>
abs
</button>
CSS
@keyframes example {
from {background-color: red;}
to {background-color: yellow;}
}
/* The element to apply the animation to */
button {
background-color: red;
animation-name: example;
animation-duration: 2s;
}
JavaScript
const button = document.querySelector("button");
button.addEventListener("animationend", () => {button.remove();})