-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (21 loc) · 878 Bytes
/
index.js
File metadata and controls
35 lines (21 loc) · 878 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
34
35
function rate(a){
var rateScore = a;
if (!rateScore) {
console.log('Sorry');
}else{
console.log(rateScore);
document.getElementById('score').innerHTML = `You selected ${rateScore} out of 5`;
}
const mainContainer = document.querySelector(".container-main")
const thanksContainer = document.querySelector(".thankyou")
const submitButton = document.getElementById("submit")
const rateAgain = document.getElementById("rate-again")
submitButton.addEventListener("click", () =>{
thanksContainer.classList.remove("hidden1")
mainContainer.style.display = "none"
})
rateAgain.addEventListener("click", () =>{
thanksContainer.classList.add("hidden1")
mainContainer.style.display = "block"
})
}