Skip to content

Commit 4685a7a

Browse files
add stop button functionality to reset countdown and clean state
1 parent 3c1df8c commit 4685a7a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Sprint-3/alarmclock/alarmclock.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ function finishCountDown() {
7575

7676
window.addEventListener("load", function () {
7777
const pauseButton = document.getElementById("pause-button");
78+
const stopButton = document.getElementById("stop");
7879
pauseButton.addEventListener("click", pauseCountDown);
80+
stopButton.addEventListener("click", () => {
81+
remainingSeconds = 0;
82+
cleanInitialState();
83+
});
7984
});
8085

8186
// DO NOT EDIT BELOW HERE

0 commit comments

Comments
 (0)