-
Notifications
You must be signed in to change notification settings - Fork 0
/
Counter.html
67 lines (67 loc) · 1.02 KB
/
Counter.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
<!DOCTYPE html>
<html>
<head>
<title>Counter</title>
<style>
#counter{
font-family: "Lucida Console", Courier, monospace;
color:#329c9c;
font-size: 150px;
text-align: center;
}
button{
/* to make round edges*/
border-radius: 10px;
background-color:#44f5f5;
border-color:#44ffff ;
color: rgb(255, 255, 255);
font-size: xx-large;
}
table{
border: 5px dotted #44f5f5;
background-color: white;
}
body{
background-color: #44f5f5;
}
h2 {
color: white;
font-size: 50px;
}
</style>
<script>
var i =0;
function increment() {
i++;
display();
}
function decrement() {
i--;
display();
}
function display() {
document.getElementById("counter").innerHTML =i;
}
</script>
</head>
<body>
<h2 align ="center">COUNTER</h2>
<table border="1" cellspacing ="30px" align ="center">
<tr>
<td colspan="2" ><h1 id="counter">0</h1></td>
</tr>
<tr>
<td>
<button onclick="increment()">
Add Count
</button>
</td>
<td>
<button onclick="decrement()">
Lower Count
</button>
</td>
</tr>
</table>
</body>
</html>