How to force focus to be set dynamically?

1
I have a vertical form with three text fields with tabindex 1, 2, and 3 respectively. Only the first and third text fields are initially visible. Tabbing succeeds from 1 to 3 as expected. But if the first field is updated to ‘yes’ I make the 2nd field visible but focus goes to the 3rd! How to make focus set to the newly visible 2nd field? Thank you.
asked
0 answers