tabindex values makes an element focusable in the natural tab order of the page?tabindex="0" places the element in the natural tab order.The tabindex="0" value makes an element focusable and places it in the natural tab order based on the document flow. Negative values like -1 make elements focusable only programmatically, and positive values like 5 change the tab order but are discouraged for accessibility.
<input type="text" ____ >
The onkeydown event triggers when a key is first pressed down. onkeypress is deprecated and inconsistent. onkeyup triggers when the key is released. onkeypressed is not a valid event.
button:focus {
outline: 3px solid #005fcc;
outline-offset: 2px;
background-color: #e0f0ff;
}The outline property creates a 3px solid blue line outside the button edges because of outline-offset: 2px. The background changes to a light blue color #e0f0ff. This helps keyboard users see which button is focused.
The :focus pseudo-class matches elements that are currently focused, including by keyboard navigation. :active matches elements being clicked. :hover matches elements under the mouse pointer. :focusable is not a valid CSS selector.
<nav role="____"> <!-- menu items --> </nav>
The menu role indicates a list of menu items that can be navigated by keyboard. The navigation role is more general for site navigation landmarks. list is for simple lists. application is for complex web apps.