-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcount.js
More file actions
28 lines (25 loc) · 725 Bytes
/
count.js
File metadata and controls
28 lines (25 loc) · 725 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
console.log("hello word");
let first_num = document.getElementById('df')
let second_num = document.getElementById('dfs')
let ui = document.getElementById('ui')
let shownum = document.getElementById('show');
function down(){
if(Number(second_num.value) < Number (first_num.value)){
console.log(second_num.value)
countDown();
}else{
alert('invalid input')
}
}
function countDown(){
let timer ;
let sec = first_num.value
let okay = second_num.value
timer = setInterval(()=>{
show.innerHTML = sec--;
if(show.innerHTML == okay){
clearinterval(timer);
alert("stop now");
}
}, 1000);
}