JSFiddle - React, Tailwind, and code Playground
HTML
<div id="a" style="background-color: red; position: relative; width: 50px; height: 50px;"></div>
<br/><br/>
<div id="b" style="background-color: red; position: relative;width: 50px; height: 50px;"></div>
JavaScript
$('#a,#b').animate({left: '250px'}, 1000, 'linear',function(){
$('#b').animate({left: '500px'}, 1000, 'linear');
});