JSFiddle - React, Tailwind, and code Playground

HTML

<div id="element">

</div>

CSS

div{
  width:100px;
  height:100px;
  border:1px solid black;
}

JavaScript

function hide() {
    return $("#element").fadeOut(1000);
}

$.when( hide() ).done(function(){
    alert("Hidden");
});