Accessibility Wiki

Anchors used as buttons need button semantics and keyboard support

Rule anchor-is-button · Links & buttons · impact moderate · Static + live

↩ Back to the rules index · WCAG cross-reference

Why it matters

An with an onclick but no href is not focusable or keyboard-operable and exposes no role. Anchors with a placeholder href ("#", "javascript:") are announced as links but act as buttons: Space does not activate them and "#" scrolls to the top of the page. Screen-reader and keyboard users can’t reliably reach or operate either.

How to fix

Use a real