- What are keyboard navigation best practices?
- How do I navigate with my keyboard?
- How do I make my element keyboard accessible?
What are keyboard navigation best practices?
The default keyboard navigation order must be logical and intuitive. This generally means that it follows the visual flow of the page—left to right, top to bottom. For most pages this means header first, then main navigation, then page navigation (if present), and finally the footer.
How do I navigate with my keyboard?
Navigating through a website with a keyboard uses the TAB key to move forward and the SHIFT+TAB combination to move backwards. These keys move you only between elements of the page that are focusable. Focusable elements are links, input fields, and buttons.
How do I make my element keyboard accessible?
An element is clickable if it has an onclick event handler defined. You can make it focusable by adding a tabindex=0 attribute value to it. You can make it operable with the keyboard by defining an onkeydown event handler; in most cases, the action taken by event handler should be the same for both types of events.