Skip to content

Commit 437f9bc

Browse files
author
JorvanW
committed
updated html and js file for alarm clock
1 parent 5eb8640 commit 437f9bc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎Sprint-3/alarmclock/alarmclock.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const timeRemaining = document.getElementById("timeRemaining");
1+
const theTime = document.getElementById("theTime");
22
let timer;
33
let seconds;
44

@@ -26,8 +26,7 @@ function decrementTimer() {
2626
const minutes = Math.floor(seconds / 60);
2727
const secs = seconds % 60;
2828

29-
timeRemaining.textContent = `Time Remaining: ${String(minutes).padStart(2, "0")}:${String(secs).padStart(2, "0")}`;
30-
29+
theTime.textContent = `${String(minutes).padStart(2, "0")}:${String(secs).padStart(2, "0")}`;
3130
if (seconds <= 0) {
3231
clearInterval(timer);
3332
playAlarm();

‎Sprint-3/alarmclock/index.html‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
</head>
99
<body>
1010
<div class="centre">
11-
<h1 id="timeRemaining">Time Remaining: 00:00</h1>
11+
<div id="timeRemaining">Time Remaining: <span id="theTime">00:00</span></div>
12+
1213
<label for="alarmSet">Set time to:</label>
1314
<input id="alarmSet" type="number" />
1415

0 commit comments

Comments
 (0)