JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box"></div>
CSS
.box {
width: 50px;
height: 50px;
background-color: #000;
transform: rotate(45deg);
}
JavaScript
var box, rotation;
box = document.querySelectorAll('.box')[0];
rotation = 0;
setInterval(function() {
rotation+=10
box.style.transform = 'rotate(' + rotation + 'deg)';
}, 100);