Skip to content

Commit 3b35e29

Browse files
committed
fix the issue
1 parent 088c50a commit 3b35e29

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sprint-3/alarmclock/alarmclock.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ function updateDisplay(heading, time) {
66

77
function setAlarm() {
88
let time = Number(document.getElementById("alarmSet").value);
9+
10+
if (!time || time <= 0) {
11+
alert("Please enter a valid time in seconds.");
12+
return;
13+
}
14+
915
const heading = document.getElementById("timeRemaining");
1016

1117
audio.loop = true;

0 commit comments

Comments
 (0)