Skip to content

Commit b61cf82

Browse files
Apply changes commented by the reviewer
1 parent d36586d commit b61cf82

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Sprint-3/alarmclock/alarmclock.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ function setScreenTimer(totalSeconds) {
88
function 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

Sprint-3/alarmclock/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
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>

0 commit comments

Comments
 (0)