JSFiddle - React, Tailwind, and code Playground

by Firdaus Zailani

HTML

<div id="test"></div>

CSS

#test {position:absolute;width:100px;height:100px;border-radius:50px;background:#F00;top:10px;left:10px}

JavaScript

var x=10;
setInterval(function(){
   x+=1
   test.style.left=x+"px";
},20)

var y=10;
setInterval(function(){
   y+=1;
   test.style.top=y+"px"
},20)