-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
77 lines (62 loc) · 2 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</head>
<link rel="stylesheet" href="style.css">
<body >
<style>
.container{
display: flex;
justify-content: center;
align-items: center;
width: 300px;
height: 50vh;
margin-top: 20px;
color: whitesmoke;
}
.counter{
text-align: center;
}
.counter h1{
font-size: 70px;
}
.counter h2{
font-size: 90px;
}
*{}
</style>
<div class="bg-info container-fluid">
<h1 class="display-1 ">
Make a Counter <br> USing JavaScript
</h1>
</div>
<!--
<div class="count">
<h1>Counter</h1>
<h2 id="num" >0</h2>
<div class="input">
<input type="button" value="+" class="btn btn-success btn-lg" onclick="counter(1)">
<input type="button" value="-" class="btn btn-danger btn-lg" onclick="counter(-1)"></div>
</div> -->
<div class="container bg-black">
<div class="counter">
<h1>Counter</h1>
<h2 id="num">0</h2>
<input type="button" value="+" class="btn btn-info btn-lg " onclick="counte(1)">
<input type="button" value="-" class="btn btn-danger btn-lg " onclick="counte(-1)">
</div>
</div>
<script>
var count=0
function counte(num){
count +=num
document.getElementById('num').innerHTML= count;
}
</script>
</body>
</html>