I have a form where there are three input boxes with three drop down select tags beside them. I want to be able to press the tab key and go from one input to another, but you have to press it twice because it goes to the drop down menu after the input box. Is there a way I can make it "skip over" the drop down menu and go right to the next input box when you press tab?
The tabindex attribute controls tabbing. Set it to -1 and the tab key will not stop on that element. Set it to a non-negative number and you can control the tab order.
The tabindex attribute specifies the tab order of an element (when the "tab" button is used for navigating). The tabindex attribute can be used on any HTML element (it will validate on any HTML element.
tabindex=0
property makes inputs skippable in case when other inputs have tabindex values above zero.
tabindex="-1"
makes input
completely skippable
You can specify the tabbing order explicitly by setting the [tabindex]
attribute:
[tabindex]
:<input type="text" /> <!-- first --> <input type="checkbox" /> <!-- second --> <select>...</select> <!-- third -->
with [tabindex]
:<input type="text" tabindex="1" /> <!-- first --> <input type="checkbox" tabindex="3" /> <!-- third --> <select tabindex="2">...</select> <!-- second -->
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With