If I use TAB on the keyboard then the cursor goes from 1 to 4 (1 → 2 → 3 → 4)
How can I skip number 3? I would like go 1 → 2 → 4.
<table> <tr><td> <input type="text" value="1"></td><td><input type="text" value="2"></td></tr> <tr><td> <input type="text" value="3"></td><td><input type="text" value="4"></td></tr> </table>
LIVE: http://jsfiddle.net/49Vca/
Just add data-skip-on-tab="true" to the elements (or containers) you want to skip. You can still click to focus them or go back using shift - tab .
The way to do this is by adding tabindex="-1" . By adding this to a specific element, it becomes unreachable by the keyboard navigation.
tabindex="0" means that the element should be focusable in sequential keyboard navigation, after any positive tabindex values and its order is defined by the document's source order.
Tab Order is the order or sequence that the cursor moves from field to field. Initially, the tab order is determined by the order in which the fields are added to the form. In many cases, as fields are moved around the page, added from a template, or pasted from somewhere else, the tab sequence may become disorganized.
If you set the tabindex = "-1" on the input itself of #3, you won't be able to tab to #3
Have a look at tabIndex property
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