gpt4 book ai didi

javascript - 弹出框自动关闭

转载 作者:可可西里 更新时间:2023-11-01 13:33:46 27 4
gpt4 key购买 nike

我需要在 3 秒内自动关闭弹出框。

请大家帮帮我

html:

<div align="center">
<!--Validation Dialogue box popup-->
<div id="blanket" style="display:none;"></div>
<div id="validationPopup" style="display:none;">
</br>

<div id="validationMessage" align="center"></div>
</div>

<form id="Reject118" name="Reject118" method="post" action="#" onsubmit="return reject_validation(this.name);">
<input type="submit" class="Reject" name="Reject" id="Reject" value="Reject" title="Click here to Reject this product item & send back for Moderator's Review" />
<br />
<textarea name="reject_reason" id="reject_reason" rows="3" cols="9" onblur="if(this.value == '')
{ this.value = 'Type Reject Reason Here';
this.style.color = '#8f8484';}" onfocus="if(this.value == 'Type Reject Reason Here'){ this.value = ''; this.style.color = '#8f8484';}" style="color:#8f8484;">Type Reject Reason Here</textarea>
</form>

我的 fiddle

FIDDLE

最佳答案

我猜 getElementById 是弹出元素,在这种情况下,下面的 JS 应该可以工作:

setTimeout(function(){
document.getElementById('validationPopup').style.display='none';
},3000)

关于javascript - 弹出框自动关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22529088/

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