JSFiddle - React, Tailwind, and code Playground
HTML
<div id="mydiv">old text</div>
JavaScript
$('#mydiv').click(function() {
$(this).html("New Text")
.animate({marginLeft: '+=10'});
});
<div id="mydiv">old text</div>
$('#mydiv').click(function() {
$(this).html("New Text")
.animate({marginLeft: '+=10'});
});