JSFiddle - React, Tailwind, and code Playground

HTML

<div id="g">Good One</div>
<br />
<div id="b">Bad One</div>

CSS

div {
    display: inline-block;
    padding: 10px;
    background: #eee;
    margin: 5px 0;
    position: relative;
}

JavaScript

document.getElementById('g').style.left = 0;
document.getElementById('b').style.left = 0;
setInterval(function(){
    var rand = Math.round(Math.random() * 20);
    document.getElementById('g').style.left = (parseInt(document.getElementById('g').style.left, 10) + rand) + 'px';
    document.getElementById('b').style.left = rand + 'px';
}, 1000)