JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html>
  <head>

    <script type="text/javascript">
    
    $(document).ready(function() {
    
      var box = $("#box"); 
      box.animate({
        opacity : 0.0
      }, {
        duration : 2000,
        complete : function() {
          $(this).slideUp();
        }
      });
      
      $.when(box).promise().done(function() {
        box.remove();
        alert('done!');
      });
    });
      
    </script>

  </head>
  <body>
    <div id="box" style="color:white;background-color:green;position:absolute;height:200px;width:200px">This is a test box</div>
    <div>Below the animated box</div>
  </body>
</html>