-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
45 lines (36 loc) · 902 Bytes
/
index.js
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
let pointhome = document.getElementById("box1");
let pointaway = document.getElementById("box2");
let reset = document.getElementById("reset");
let counthome = 0;
let countaway = 0;
function onepointhome() {
counthome += 1;
pointhome.textContent = counthome;
}
function twopointhome() {
counthome += 2;
pointhome.textContent = counthome;
}
function threepointhome() {
counthome += 3;
pointhome.textContent = counthome;
}
function onepointaway() {
countaway += 1;
pointaway.textContent = countaway;
}
function twopointaway() {
countaway += 2;
pointaway.textContent = countaway;
}
function threepointaway() {
countaway += 3;
pointaway.textContent = countaway;
}
function resetboth() {
counthome = 0;
countaway = 0;
pointhome.textContent = counthome;
pointaway.textContent = countaway;
}
reset.addEventListener("click", resetboth);