Tab Order and Keyboard Shortcuts - HTML

Two additional attributes, tabindex and accesskey, should be used with your form fields to increase their accessibility. The tabindex attribute defines what order the fields are selected in when the user presses the Tab key. This attribute takes a numeric argument that specifies the field’s order on the form.

The accesskey attribute defines a key that the user can press to directly access the field. This attribute takes a single letter as an argument—that letter becomes the key the user can press to directly access the field.

Note: Keys specified in accesskey attributes usually require an additional key to be pressed with the key. For example, user agents running on Windows require the Alt key to be pressed along with the letter specified by accesskey. Other platforms require similar keys—such keys typically follow the GUI interface conventions of the platform.

The following example defines a text box that can be accessed by pressing Alt+F (on Windows platforms), and is third in the tab order:

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

HTML Topics