r/JavaScriptHelp • u/foundry41 • Dec 05 '20
❔ Unanswered ❔ Tabbing to next input in a form where there are extra buttons in the <form>
I have a form that, give or take, looks like this
<form>
<input type="password" />
<button>Show</button>
<input type="password" />
</form>
Basically, there are two password inputs and a button (which in reality is positioned absolute inside of the input). The button can toggle (show/hide) the password.
When using tab to jump from input #1 to input #2, the first time you hit tab it focuses on the button rather than going to input.
Is there a property on the button I'm missing that will "take it out of the form", so that it doesn't recognize the button as a form input that can be tabbed to?