set animation in javascript code example
Example 1: start animation with javascript
element.addEventListener("click", function(e){
element.classList.remove("anim");
setTimeout(() => element.classList.add("anim"), 0);
}, false);
Example 2: js add animation to element
let rotate360 = [
{ transform: 'rotate(360deg)' }
];