File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ function setScreenTimer(totalSeconds) {
88function setAlarm ( ) {
99 const alarmSet = document . getElementById ( "alarmSet" ) ;
1010 let totalSeconds = Number ( alarmSet . value ) ;
11+ if ( totalSeconds <= 0 ) {
12+ alert ( "Input must be more than 0" ) ;
13+ alarmSet . value = "" ;
14+ return ;
15+ }
1116
1217 setScreenTimer ( totalSeconds ) ;
1318
Original file line number Diff line number Diff line change 1010 < div class ="centre ">
1111 < h1 id ="timeRemaining "> Time Remaining: < span > 00:00</ span > </ h1 >
1212 < label for ="alarmSet "> Set time to:</ label >
13- < input id ="alarmSet " type ="number " />
13+ < input id ="alarmSet " type ="number " min =" 0 " />
1414
1515 < button id ="set " type ="button "> Set Alarm</ button >
1616 < button id ="stop " type ="button "> Stop Alarm</ button >
You can’t perform that action at this time.
0 commit comments