Buttons and links with no name
Icon buttons for search, the cart, or the menu look obvious on screen. In the code, many have no text at all, so the screen reader says "button" and nothing else. Links that say "Click here" or "Read more" make no sense when someone pulls up a list of every link on the page, and fail outright when nothing around them says where they go.
- Now
- “Button”
- Fixed
- “Search, button”
The fix
Give every control a name that says what it does. Visible text is best. For an icon-only button, add an aria-label and hide the icon itself. For links, use words that make sense on their own, like "Read the shipping policy."
<button type="button">
<svg>…</svg>
</button><button type="button" aria-label="Search">
<svg aria-hidden="true">…</svg>
</button>