I would like to remove div first, then show my popup. But while showing the alert I am able to see the div. Once closing the popup the div will be removed.
$("#btnRemoveDiv").on("click",function(){$("#divRemove").remove();
alert("Removed");});
<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">

@quirimmo Please see this: