-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
45 lines (36 loc) · 1.08 KB
/
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 homeScoreBtnOne = document.getElementById("home-score-btn-1")
let homeStoreEl =document.getElementById("home-score")
let homeScore = 0
function increaseHomeScoreOne(){
homeScore += 1
homeStoreEl.textContent = homeScore
}
let homeScoreBtnTwo = document.getElementById("home-score-btn-2")
function increaseHomeScoreTwo(){
homeScore += 2
homeStoreEl.textContent = homeScore
}
function increaseHomeScoreThree(){
homeScore += 3
homeStoreEl.textContent = homeScore
}
let guestScoreBtnOne = document.getElementById("guest-score-btn-1")
let guestStoreEl =document.getElementById("guest-score")
let guestScore = 0
function increaseGuestScoreOne(){
guestScore += 1
guestStoreEl.textContent = guestScore
}
function increaseGuestScoreTwo(){
guestScore += 2
guestStoreEl.textContent = guestScore
}
function increaseGuestScoreThree(){
guestScore += 3
guestStoreEl.textContent = guestScore
}
const refreshButton = document.querySelector('.new-game-button');
const refreshPage = () => {
location.reload();
}
refreshButton.addEventListener('click', refreshPage)