-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclickerGame.html
More file actions
33 lines (27 loc) · 789 Bytes
/
clickerGame.html
File metadata and controls
33 lines (27 loc) · 789 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>2 hollis clicker game</title>
</head>
<body>
<a href="index.html">back to home</a>
<h1>2 hollis Clicker Game</h1>
<p>Score: <span id="score">0</span></p>
<button id="clickButton">2 hollis</button>
<button id="clickbutton">choboni upgrade</button>
<script>
let score = 0;
const scoreDisplay = document.getElementById("score");
const button = document.getElementById("clickButton");
const upgradeButton = document.getElementById("clickbutton");
button.addEventListener("click", function() {
score++;
scoreDisplay.textContent = score;
});
upgradeButton.addEventListener("click", function() {
score += 10;
scoreDisplay.textContent = score;
});
</script>
</body>
</html>