-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCountNumber.html
37 lines (37 loc) · 1.17 KB
/
CountNumber.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CountNumber</title>
<link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet">
<style>
h1 {
font-family: 'Varela Round', sans-serif;
font-size: 15em;
text-align: center;
color: orangered;
}
body {
background-color: orange;
}
</style>
</head>
<body>
<h1 id="count"></h1>
<script>
var number = 30;
var countDown = setInterval(function () {
document.getElementById('count').innerHTML = number;
if (number > 0) {
--number; // Decrease one Second Every 1000 Millisecond
} else {
clearInterval(countDown); // Stop CountDown Timer
document.getElementById('count').innerHTML = "หยุด";
}
}, 1000);
//read more: https://github.com/kkenth007/Data-structure-PDF/blob/master/CountNumber.pdf
</script>
</body>
</html>