JSFiddle - React, Tailwind, and code Playground

HTML

<div id="aaa">click here to start the loop</div>
<div id="bbb">bbb</div>

CSS

#aaa, #bbb {
    width:100px;
    height: 100px;
    border: 1px solid plum;
}

JavaScript

$('#aaa').click( function() {

$('#bbb').animate(
    {width:200},
    1000,
    undefined,
    function() { throw "lets start again"}
);

} );