JSFiddle - React, Tailwind, and code Playground

HTML

<div id="mydiv">old text</div>

JavaScript

$('#mydiv').click(function() {
    $(this).html("New Text")
        .animate({marginLeft: '+=10'});
});