26-03-2021 | #html
tabindex attribute indicates whether the element can be focused. It also shows the order in the sequential keyboard navigation.
It accepts an integer.
0: The element can be focused by sequential keyboard navigation. It will be focused after positive
tabindex. This is the default value
- A positive value: the element can be focused on by sequential keyboard navigation. Its order is defined by the value of the number. The elements with positive values will be focused before those with
If there are many elements with the same value, their order is defined by the document's source order
When you press
tab key, the focus ring will be navigated in the order 1, 2, 3, 4, 0. The element with
tabindex="-1" can't be focused.