HTML has a native way to do this: <details> <summary> That’s it. You get open/close behavior, keyboard support, accessible structure, and a pretty clean base to style with CSS. You can even use the ...
Setting the alarm: Once everything checks out, it saves the selected time, flips the isAlarmSet flag to true, disables the dropdowns so the time cannot be changed mid-alarm and updates the button to ...