How do I change the order the elements on my page are given focus?
Question
Answer
Tab focus order will follow the DOM order of elements by default. If your issue is solely related to elements being out of order, you should reorder the DOM so the elements are in the correct order.
Another related tactic is to use the tabindex attribute. A tabindex of -1 (tabindex="-1") will remove an element from the tab order. A tabindex of 0 (tabindex="0") will add an element to the focus order.
It is highly recommended to avoid positive tabindex values and to structure your DOM in the correct order.
Free Tools to Continue Learning
Accessible Web RAMP
Monitor your website and manage your progress towards WCAG conformance.
Accessible Web Academy
Career specific courses to help power up your accessibility knowledge.