我想首先删除div,然后显示我的弹出窗口.但在显示警报时,我能够看到div.关闭弹出窗口后,div将被删除.
$("#btnRemoveDiv").on("click",function(){$("#divRemove").remove();
alert("Removed");});Run Code Online (Sandbox Code Playgroud)
<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">Run Code Online (Sandbox Code Playgroud)
@quirimmo请看这个: