var t = settimeout("javascript statement",milliseconds);
<body>
<script language="javascript" type="text/javascript">
function delayedalert(){
settimeout("alert('this alert was delayed');",3000);
}
function normalalert(){
alert('no timeout');
}
</script>
<button onclick="normalalert();">no timeout</button>
<button onclick="delayedalert();">delayed alert</button>
</body>
时间: 2024-11-05 18:29:53