Skip to content

Commit 0bae369

Browse files
Make some change on how to the error display without interfere with the main heading
1 parent a04f01c commit 0bae369

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Sprint-3/alarmclock/alarmclock.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ function resetAlarm() {
44
clearInterval(countdown);
55
countdown = null;
66
pauseAlarm();
7-
updateHeading(0);
87
}
98

109
function 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();

Sprint-3/alarmclock/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
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

0 commit comments

Comments
 (0)