-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
50 lines (44 loc) · 821 Bytes
/
app.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
46
47
48
49
50
let sum1 = 0;
let sum2 = 0;
let homeEl = document.getElementById("home-el");
let guestEl = document.getElementById("guest-el");
function home1() {
sum1 += 1;
homeEl.textContent = sum1;
}
function home3() {
sum1 += 3;
homeEl.textContent = sum1;
}
function home6() {
sum1 += 6;
homeEl.textContent = sum1;
}
function guest1() {
sum2 += 1;
guestEl.textContent = sum2;
}
function guest3() {
sum2 += 3;
guestEl.textContent = sum2;
}
function guest6() {
sum2 += 6;
guestEl.textContent = sum2;
}
function reset() {
sum1 = 0;
sum2 = 0;
homeEl.textContent = 0;
guestEl.textContent = 0;
}
function backhome() {
sum1 = sum1 - 1;
homeEl.textContent = sum1;
guestEl.textContent = sum2;
}
function backguest() {
sum2 = sum2 - 1;
homeEl.textContent = sum1;
guestEl.textContent = sum2;
}