这是你想要的吗? Test
实施例测试1:
HTML测试1:
<input type="button" value="Test" onclick="showAlert();"></input>
JAVASCRIPT测试1:
function showAlert() {
setTimeout(function() {
alert('thanks the content has been submitted for review');
},5000); // 5 seconds
}
实施例处理的JavaScript的onclick和表示延迟前警报:Test2
JAVASCRIPT的Test2:
document.getElementById("myButton").onclick=function(){showAlert()};
function showAlert() {
alert('thanks the content has been submitted for review');
setTimeout(function() {
// DO OTHER STUFF
},5000); // 5 secon
}
实施例示出了在DIV警报:Test3
HTML Test3的:
<input id="myButton" type="button" value="Test"></input>
<div id="alert" style="display: none;">
thanks the content has been submitted for review.
</div>
JAVASCRIPT Test3的:
document.getElementById("myButton").onclick=function(){showAlert()};
function showAlert() {
document.getElementById("alert").style.display = "block";
setTimeout(function() {
// DO OTHER STUFF
},5000); // 5 secon
}
CSS Test3的(很简单):
#alert {
border: 1px solid;
height: 20px;
width: 400px;
position: absolute;
left: 150px;
top: 40px;
}
是,请提供现有的代码。 – sinisake
是的,这是可能的。请告诉我们你到目前为止所尝试过的。 –
是的,这是可能的JS –