JSFiddle - React, Tailwind, and code Playground

by Kai_Draord

HTML

<div class="box" id="runner">
  
</div>

CSS

@keyframes spin {
  0% {transform:rotate(0deg);}
  100% {transform:rotate(360deg);}
}

.box.running {
  animation-name:spin;
  
#runner{
  width:50px;
  height:50px;
  background-color:red;
}

JavaScript

console.log(document.getElementById("runner"));
document.getElementById("runner").className += " running";