<div tabindex="2">Second</div>
<div tabindex="1">First</div>
Positive values will insert the element at the tabbing order position of its respective value. Elements without preference (i.e. tabindex="0"
or native elements such as button
and a
) will be appended after those with preference.
Positive values are not recommended as they disrupt the expected behavior of tabbing and might confuse people who rely on screenreaders. Try to create a natural order by rearranging your DOM structure.