<!DOCTYPE html>
<html>
<title>Web Page Design</title>
<head>
<script src="script.js"></script>
</head>
<body>
<div id="starttext" onclick="passStart()"></div>
</body>
</html>
//倒计时3秒,然后弹出Hello,word!
var timeleft =3;
var int=self.setInterval("passStart()",1000);
function passStart()
{
console.log(timeleft)
if(timeleft===-1){
sayHello ();
}else{
document.getElementById('starttext').innerHTML='跳过('+timeleft+')';
--timeleft;
}
}
function sayHello(){
alert("Hello,word!");
}