-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcount.js
35 lines (30 loc) · 835 Bytes
/
count.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
//create a global variable and the it
var down=10;
var run=setInterval(()=>{
down-=1;
var drp=document.querySelector(".reduce");
drp.innerHTML=down;
/*stop timer when it 0*/
if(down===0){
clearInterval(run);
let show=document.querySelector(".load");
show.style.display="block";
}
},1000
);
//Time script
const time=()=>{
let greet=new Date().toLocaleTimeString();
document.getElementById("time").innerHTML=greet;
if(greet<=12){
document.getElementById("talk").innerHTML="GOOD MORNING";
}
else if(greet>=13 && greet==16){
document.getElementById("talk").innerHTML="GOOD AFTERNOON";
}
else{
document.getElementById("talk").innerHTML="GOOD MORNING";
}
}
setInterval(time,1000);
time();