JSFiddle - React, Tailwind, and code Playground

HTML

baseline
<div>
    some text and an inline block element <span></span>
</div>
<br>
<button>
    Animate for 2 seconds
</button>

CSS

span {
    display: inline-block;
    width: 10px;
    height: 50px;
    background: red;
}
div {
    display: inline-block;
    border: solid;
}
.animating {
    margin-bottom: -.2em;
}

JavaScript

var i = 0;
$('button').click(function() {
    $('div').
        addClass("animating").
        animate({ height: ++i % 2 ? 300 : 100 }, 2000).
        queue(function() {
            $(this).removeClass("animating").dequeue();
        });
});