-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathindex.html
49 lines (47 loc) · 1.06 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Click Counter</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin: 50px;
}
.counter-box {
background: #f2f2f2;
padding: 20px;
border-radius: 10px;
width: 200px;
margin: auto;
}
#count {
font-size: 24px;
color: blue;
}
button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
</style>
</head>
<body>
<h1>Simple Click Counter</h1>
<div class="counter-box">
<p>Click Count: <span id="count">0</span></p>
<button id="btn">Increase</button>
</div>
<script>
let count = 0;
document
.getElementById("btn")
.addEventListener("click", function () {
count =+ 1;
document.getElementById("count").innerText = count;
});
</script>
</body>
</html>