Sheffield | 26-ITP-Jan | Martha Ogunbiyi | Sprint 3| Alarm clock#1167
Sheffield | 26-ITP-Jan | Martha Ogunbiyi | Sprint 3| Alarm clock#1167marthak1 wants to merge 5 commits intoCodeYourFuture:mainfrom
Conversation
Sprint-3/alarmclock/alarmclock.js
Outdated
| const title = document.querySelector('title') | ||
| title.textContent = "Alarm clock app"; |
There was a problem hiding this comment.
Why did you undo the change where you changed the title in the HTML first?
There was a problem hiding this comment.
Thanks for the feedback. I originally changed the title via the DOM to practice DOM manipulation, but I’ve now updated it in the HTML file to match the requirements.
| let seconds = num % 60; | ||
| return minutes.toString().padStart(2, '0') + ":" + seconds.toString().padStart(2, '0'); | ||
| } | ||
| function setAlarm() { |
There was a problem hiding this comment.
What happens when a user clicks the set alarm button while the countdown is already running?
There was a problem hiding this comment.
Thanks for the feedback. Function has now been updated to stop multiple timers
Sprint-3/alarmclock/alarmclock.js
Outdated
| } | ||
| function setAlarm() { | ||
| const alarmSetInputEl = document.getElementById("alarmSet"); | ||
| let timeEl = Number(alarmSetInputEl.value); |
There was a problem hiding this comment.
What happens if the user enters a negative number or a non number string?
There was a problem hiding this comment.
Thanks for the feedback, Function now updated to validate input.
Learners, PR Template
Self checklist
Changelist
Built alarm clock app as per requirements