-
Notifications
You must be signed in to change notification settings - Fork 0
/
5.html
90 lines (63 loc) · 1.48 KB
/
5.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
body {
background-color: black;
}
</style>
<title>Increment count when button is clicked</title>
<script type="text/javascript">
var count = 1;
function go() {
document.getElementById("btn").disabled = true;
document.getElementById("textbor").innerHTML = "You got " +clicks+ " clicks in 5 seconds. Refresh the page to restart.";
}
</script>
<style>
#btn {
background-position: center;
transition: background 0.3s;
}
#btn:hover {
background: black radial-gradient(circle, transparent 1%, black 1%) center/15000%;
}
#btn:active {
border: none;
background-color: green;
background-size: 100%;
transition: background 0s;
}
/* Button style */
#btn {
border-radius: 5px;
width: 100%;
border: none;
padding: 12px 18px;
font-size: 14px;
cursor: pointer;
color: white;
background-color: black;
box-shadow: 0 0 4px #999;
}
</style>
</head>
<body style="text-align: center;">
<button id="btn">
<br><br>
<p id="textbor">Click here start</p>
<br><br>
</button>
<script type="text/javascript">
var clicks = 0;
btn.onclick = function () {
count--;
setTimeout("go()", 5000);
clicks++;
document.getElementById("textbor").innerHTML = "Click me";
}
</script>
</body>
</html>