JSFiddle - React, Tailwind, and code Playground

by WouterJ

HTML

<div id="box" class="css-box"></div>

CSS

.css-box{
    position: relative;
    width : 100px;
    height : 100px;
    margin : auto;
    background-color : blue;
}

JavaScript

var box = document.getElementById("box");

box.style.left = 0;

var pushBox = function(e){
    box.style.left = parseInt(box.style.left) + 1 + "px";
};

document.addEventListener("mousemove" , pushBox);