JSFiddle - React, Tailwind, and code Playground

HTML

<div id="foo">
&nbsp;
</div>
<div id="bar">
&nbsp;
</div>
<input type="button" value="reset" id="reset" />

CSS

#foo, #bar {
  height:100px;
  width:100px;
  position : absolute;
}
#foo {
  background-color:red;
  top: 100px;
  left: 80px;
  
}
#bar {
  background-color:green;
  top: 300px;
  left :50px;
}

JavaScript

$( function(){

$("#foo, #bar").on('click', function(){
$(this).data('left', $(this).position().left)
       .css('left', '200px');
})

$("#reset").on('click', function(){
$("#foo").css('left', $("#foo").data('left') );
$("#bar").css('left', $("#bar").data('left') );

})

})