Skip to content

Commit f8431ee

Browse files
committed
tic tock
1 parent 96d077b commit f8431ee

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Sprint-3/alarmclock/alarmclock.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
function setAlarm() {}
1+
let timeIn = document.getElementById("alarmSet").value;
2+
let countDown = document.getElementById("timeRemaining");
3+
4+
function setAlarm() {
5+
timeIn--;
6+
countDown.innerHTML = "timeRemaining " + ":" + timeIn;
7+
if (timeIn < 1) {
8+
playAlarm;
9+
clearInterval(timer);
10+
}
11+
}
12+
const timer = setInterval(setAlarm, 1000);
13+
14+
// setTimeout(count, 1000);
215

316
// DO NOT EDIT BELOW HERE
417

0 commit comments

Comments
 (0)