File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,11 +4,10 @@ function resetAlarm() {
44 clearInterval ( countdown ) ;
55 countdown = null ;
66 pauseAlarm ( ) ;
7- updateHeading ( 0 ) ;
87}
98
109function showError ( message ) {
11- const heading = document . getElementById ( "timeRemaining " ) ;
10+ const heading = document . getElementById ( "errorMessage " ) ;
1211 heading . innerText = message ;
1312}
1413
@@ -23,6 +22,8 @@ function setAlarm() {
2322 return ;
2423 }
2524
25+ document . getElementById ( "errorMessage" ) . innerText = "" ;
26+
2627 if ( time === 0 ) {
2728 updateHeading ( 0 ) ;
2829 playAlarm ( ) ;
Original file line number Diff line number Diff line change 99 < body >
1010 < div class ="centre ">
1111 < h1 id ="timeRemaining "> Time Remaining: 00:00</ h1 >
12+ < p id ="errorMessage " style ="color: red; "> </ p >
1213 < label for ="alarmSet "> Set time to:</ label >
1314 < input id ="alarmSet " type ="number " />
1415
You can’t perform that action at this time.
0 commit comments