-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
44 lines (30 loc) · 941 Bytes
/
main.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
let tasbiih = document.querySelector("#Tasbiih")
let resetbutton = document.querySelector("#resetbtn")
let increasebutton = document.querySelector("#increasbtn")
let initialvalue = 0
increasebutton.addEventListener("click", function(){
initialvalue++
tasbiih.innerHTML = initialvalue
if(initialvalue ==4){
document.body.style.backgroundColor = "red"
}
else if(initialvalue ==5){
document.body.style.backgroundColor = "blue"
}
else if(initialvalue ==6){
document.body.style.backgroundColor = "green"
}
else if(initialvalue ==7){
document.body.style.backgroundColor = "orange"
}
else if(initialvalue ==8){
document.body.style.backgroundColor = "yellow"
}
else{
document.body.style.backgroundColor = ""
}
})
resetbutton.addEventListener("click", function(){
initialvalue = 0
tasbiih.innerHTML = initialvalue
})