YouTip LogoYouTip

Att Global Tabindex

## HTML tabindex Attribute The `tabindex` attribute is an HTML global attribute that specifies the tab order of an element when the user navigates the page using the "Tab" key. By default, only certain interactive elements (such as links and form controls) can receive keyboard focus. The `tabindex` attribute allows developers to control this focus order and make non-interactive elements focusable for better accessibility. --- ## Browser Support The `tabindex` attribute is fully supported by all modern web browsers: * Google Chrome * Mozilla Firefox * Microsoft Edge / Internet Explorer * Safari * Opera --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | `negative integer` (usually `-1`) | The element is focusable via JavaScript (using `.focus()`), but it is excluded from sequential keyboard navigation (cannot be reached via the Tab key). | | `0` | The element is placed in the default navigation flow. Its tab order is determined by its relative position in the document source code. | | `positive integer` (e.g., `1`, `2`, `3`) | The element is placed in a custom navigation order. Elements with positive `tabindex` values are focused first, in ascending numerical order, before elements with `tabindex="0"` or default focusable elements. | --- ## HTML 4.01 vs. HTML5 * **HTML5:** The `tabindex` attribute is a **global attribute**, meaning it can be applied to any HTML element (though it may not always be semantically useful or accessible to do so). * **HTML 4.01:** The `tabindex` attribute could only be applied to a limited set of interactive elements: ``, ``, `