JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html>
  <head>

    <script type="text/javascript">
    
    $(document).ready(function() {
    
      var slideUpAndRemove = function() {
        $(this).slideUp(function() { 
          $(this).remove(); 
        });
      }
      
      var box = $("#box"); 
      box.animate({
        opacity : 0.0
      }, {
        duration : 2000,
        complete : slideUpAndRemove
      });
      
      $.when(box).done(function() {
        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>