A webpage should make sense even when someone cannot see its colors, pictures, or layout.
What You Need to Know
Try navigating without a mouse. Tab should reach real controls, and Enter or Space should activate them according to their usual behavior. A clickable-looking div is not automatically a usable button.
In this example: navigate a form using only the keyboard.
Try the Example
Take a look at the example. We’ll explain the important lines right below it.
<a href="/lessons">Browse lessons</a>
<button type="button">Start a quiz</button>
<label for="student">Your name</label>
<input id="student" name="student">
<p>Press Tab, Shift+Tab, Enter, and Space to test the controls.</p>
Let’s Read the Code
- <button>: The button offers an action; its type or command determines what happens.
- <label>: The label tells people what the input is for. A matching for/id pair makes the label clickable.
- href: Href is the URL to a related resource or destination.
- type: Type changes what sort of control or resource the browser uses.
What the example shows: Links navigate, buttons activate actions, and native inputs receive keyboard focus by default.
What Happens in the Browser?
Try this with Tab and Shift+Tab. If you can, inspect the accessibility tree too; appearance alone does not tell the whole story.
A quick keyboard check: Press Tab to move forward, Shift+Tab to go back, and Enter or Space to activate controls when appropriate. Watch where focus goes. If you cannot tell which control is active, the interface needs improvement.
Your Turn
Move through the example without a mouse. Read each control name and current state aloud as if describing it to a friend.
Common Beginner Mistakes
- Judging the page only by how it looks, without checking its meaning and keyboard behavior.
- Do not use an anchor without href as a fake button or a clickable div without keyboard support.
Key Takeaways
- Try navigating without a mouse.
- <button>: The button offers an action; its type or command determines what happens.
- A meaningful HTML element is usually a stronger starting point than adding an ARIA role to a generic div. Also check what happens using only the keyboard.