JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<div id="div1"></div>
<div id="div2"></div>

CSS

div {
    width:50px;
    height:100px;
    border: 2px dashed orange;
    margin: 4px;
}

JavaScript

var div2 = $('#div2');

var i = 0;

$('#div1').animate({
    width: 100
}, {
    duration: 2000,
    step: function() {
        div2.text(++i);
    },
    complete: function() {
        alert('done');
    }
});