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?
2 Answers
tabindex=0
property makes inputs skippable in case when other inputs have tabindex values above zero.
tabindex="-1"
makes input
completely skippable
-
9@j08691 He was giving another option other than to number the tab indexes Nov 17, 2012 at 23:33
-
@eshellborn - looks like the exact same advice as given by myself and zzzzBov.– j08691Nov 18, 2012 at 3:58
-
16That is not correct.
tabindex=0
tells the browser to figure out the tab order on it's own, whiletabindex=-1
will make it skip Dec 9, 2014 at 11:12 -
9the "best answer" is not a good answer in the case of dynamically generated inputs (such as ngModel) where you want to consistently skip one specific input (for ex. a column in a table). @elDude answer hits the nail on the head, and it baffles me why anyone would question its usefullness Mar 24, 2017 at 21:50
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 -->
tabIndex
attribute? w3.org/TR/1999/REC-html401-19991224/interact/…