JSFiddle - React, Tailwind, and code Playground

by gooodwin67

HTML

<div id = 'test'></div>

CSS

#test {
  width: 50px;
  height: 50px;
  background: red;
  position: relative;
}

JavaScript

var a = $('#test');
var x = 0;

function animate() {

  if (x < 300) {
    x = x + 5;
    a.offset({left:x});
  }

  
}  
  setInterval(animate,10);