-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (32 loc) · 1.08 KB
/
index.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
<hmtl>
<head>
<title>COUNTER </title>
<link rel="stylesheet" type="text/css" href="style1.css">
</head>
<body>
<div class="container">
<h1 class="head">COUNTER</h1>
<div id="num">0</div>
<form onsubmit="incr(); return false;">
<input type="submit" class="bind1" value="ADD">
</form>
<form onsubmit="decr(); return false;">
<input type="submit" class="bind2" value="LOW">
</form>
</div>
</body>
<script>
//let counter=0;
let counter=document.getElementById('num').innerHTML;
function incr()
{
counter++;
document.querySelector('#num').innerHTML=counter;
}
function decr()
{
counter--;
document.querySelector('#num').innerHTML=counter;
}
</script>
</hmtl>