<!DOCTYPE html>
<html>
<head>
<title>clickNum.html</title>
<!-- 记录点击次数 -->
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
var count = 0
function countClick(){
count += 1
co = document.getElementById("co")
co.innerHTML=count
judge()
}
function doubleAdd(){
count *=2
co.innerHTML=count
judge()
}
function setZero(){
count = 0
co.innerHTML=count
}
function judge(){
if(count>1000){
f = document.getElementById("f")
f.innerHTML = '<h1>您点燃了定时炸弹,爆炸了</h1>'
}
}
</script>
</head>
<body>
<div id="f">
<input value="点击" type="button" onClick="countClick()">
<input value="加倍" type="button" onClick="doubleAdd()">
<input value="归零" type="button" onClick="setZero()">
<br>
您已经点击了<label id="co">0</label>次
</div>
</body>
</html>