I'm working on my first project and I'm stuck with something. I created input values for my alarm, but I'm stuck with how to use the function to correlate it to the user’s selected values. I want to do something like,
let selectedHour = hour options from the info in the function.value or something and do that for mins and seconds of course.. I just don't know how. Thanks everyone.
This is the function I created to show alarm time selections:
function alarmMenu(){
let ahours = document.querySelector("#alarmhrs)
let hrs = 12
for (i=0; i <= hrs; i++) {
ahours.options[ahours.options.length] = new Option( i < 10 ? "0" + i : i, i);
}
let amins = document.querySelector("#alarmmins");
let min = 59;
for (i=0; i <= min; i++) {
amins.options[amins.options.length] = new Option(i < 10 ? "0" + i : i, i);
}
let asecs = document.querySelector("#alarmsecs");
let sec = 59;
for (i=0; i <= sec; i++) {
asecs.options[asecs.options.length] = new Option(i < 10 ? "0" + i : i, i);
}
}
alarmMenu();