0Pricing
Web Accessibility Academy · Lesson

The href-less Anchor Anti-Pattern

Why a fake link breaks keyboard and screen reader users.

The Fake Link

A common anti-pattern is an anchor with no href, wired up with a click handler to act like a button. It looks fine but breaks things.

<a onclick="openMenu()">Menu</a>

No href, No Link

An anchor only counts as a real link when it has an href. Without one, the browser does not treat it as interactive at all.

All lessons in this course

  1. Links Go Places, Buttons Do Things
  2. Link Text That Makes Sense Out of Context
  3. Buttons That Announce What They Do
  4. The href-less Anchor Anti-Pattern
← Back to Web Accessibility Academy