gpt4 book ai didi

javascript - 我正在尝试从 javascript 加载一个弹出窗口,它可以工作,但是,当我单击关闭弹出窗口时,没有任何反应

转载 作者:行者123 更新时间:2023-11-28 02:24:52 26 4
gpt4 key购买 nike

我编写了以下代码以在页面加载时加载弹出窗口,但是,当我单击“继续”关闭弹出窗口时 - 没有任何反应。按钮缩进但弹出窗口保持不变。我想知道是否有人有任何想法?

<p>This is the normal text that would be on the page anyway.</p>

<p>There's an awful lot of this text on a normal page with lots of graphics and stuff as well.</p>


<div id="reminderPopup">
<div class="popupBackground">
<div class="popupInner">
<h2>Remember, if you have opened and resolved a complaint on this call to close the ADR.</h2>
<p><!--additional text here--></p>
<button id="close" onclick="closeReminderPopup()">Continue</button>
<p>&nbsp;</p>
</div>
</div>
</div>

<script type="text/javascript"> 
function pageLoadCompleteEvent(){
document.getElementById("reminderPopup").style.display="block";
};
function closeReminderPopup(){
document.getElementById("reminderPopup").style.display="none";
};
</script>

最佳答案

您的代码运行良好。尝试在代码片段工具中运行它:

	function pageLoadCompleteEvent(){
document.getElementById("reminderPopup").style.display="block";
};
function closeReminderPopup(){
document.getElementById("reminderPopup").style.display="none";
};
<html>
<body>
<p>This is the normal text that would be on the page anyway.</p>

<p>There's an awful lot of this text on a normal page with lots of graphics and stuff as well.</p>


<div id="reminderPopup">
<div class="popupBackground">
<div class="popupInner">
<h2>Remember, if you have opened and resolved a complaint on this call to close the ADR.</h2>
<p><!--additional text here--></p>
<button id="close" onclick="closeReminderPopup()">Continue</button>
<p>&nbsp;</p>
</div>
</div>
</div>
</body>
</html>

关于javascript - 我正在尝试从 javascript 加载一个弹出窗口,它可以工作,但是,当我单击关闭弹出窗口时,没有任何反应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54903484/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com