HTML · Global attributes

tabindex

Changes keyboard focus order. Use 0 to include an element in the natural order; avoid positive numbers.

Syntax
tabindex="0"

Example

Try it

Notes

Prefer native interactive elements. Positive tabindex values fight the document order.

More in this group

accesskey aria-atomic aria-controls aria-current aria-describedby aria-disabled aria-expanded aria-hidden

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course