<!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>