Skip to content

Commit c283013

Browse files
wrote a statement to check for empty input
1 parent 80d4b45 commit c283013

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎Sprint-3/alarmclock/alarmclock.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ function reset() {}
77
function setAlarm() {
88
const input = document.getElementById("alarmSet");
99
const value = input.value.trim();//trim empty string
10+
//Check if the input is empty
11+
if(value ===""){
12+
alert("Please enter a number of seconds .");
13+
}
1014

1115
const seconds = Number(input.value);
1216

0 commit comments

Comments
 (0)