-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
55 lines (43 loc) · 1.25 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
46
47
48
49
50
51
52
53
54
55
// Home Score
let homeScore = 0
document.getElementById("actual-score").textContent = homeScore
function addOne() {
let result = homeScore + 1
homeScore = result
document.getElementById("actual-score").textContent = result
}
function addTwo() {
let result = homeScore + 2
homeScore = result
document.getElementById("actual-score").textContent = result
}
function addThree() {
let result = homeScore + 3
homeScore = result
document.getElementById("actual-score").textContent = result
}
// Guest Score
let guestScore = 0
document.getElementById("guest-Score").textContent = guestScore
function addguestOne() {
let result = guestScore + 1
guestScore = result
document.getElementById("guest-Score").textContent = result
}
function addguestTwo() {
let result = guestScore + 2
guestScore = result
document.getElementById("guest-Score").textContent = result
}
function addguestThree() {
let result = guestScore + 3
guestScore = result
document.getElementById("guest-Score").textContent = result
}
// New Game
function newGame() {
homeScore = 0
document.getElementById("actual-score").textContent = homeScore
guestScore = 0
document.getElementById("guest-Score").textContent = guestScore
}