JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<div id="divRemove">Remove this div first then show the popup. Dont show this while the popup is opened!</div>
<input type="button" id="btnRemoveDiv" value="Remove">
JavaScript
$("#btnRemoveDiv").on("click",function(){$("#divRemove").remove();
setTimeout(function(){
alert("Removed");});
}),500;