How to move focus to another input element

image

This is a card I’m working on… does what you’d expect. Choose inputs, hit “Set” and it does stuff. On a PC browser it works perfectly. Problem is when I use it on a phone: select (say) end time hours and change the number, then immediately hit “Set”. Focus doesn’t automatically change to the Set button, which means that the updated hours figure is ignored and the script sees the wrong number. Manually moving the focus (eg select minutes) works but isn’t a good user experience.

I’m thinking I could fix this in my script by forcing a change of focus before I read the numbers, but I can’t see a way to do that. Can anyone help?

(NB - using an automation to look for a change won’t give me the right logic - I really need to go when the button is pressed)