Unique accesskey values

Last updated:

How to fix duplicate accesskey values?

Make sure every accesskey attribute on the page has a unique value:

BAD:

two elements share the same accesskey

<a href="/home" accesskey="h">Home</a>
<a href="/help" accesskey="h">Help</a>
CORRECT:

each element has a unique accesskey

<a href="/home" accesskey="h">Home</a>
<a href="/help" accesskey="e">Help</a>

If you do not need the accesskey feature, remove the attribute entirely.

Why is this important?

When two elements share the same accesskey, the browser decides which one to activate. This behavior differs between browsers and is not predictable. Keyboard users and assistive technology users who rely on accesskeys cannot depend on the shortcut working as expected.

More info:

WCAG 4.1.1 Parsing.

Rule info

Standard

Best practice

User impact

Fix complexity

Affects

Was this article helpful?

Checkout the ExcellentWebCheck services

ExcellentWebCheck's goal is to improve the online user experience. The tools of ExcellentWebCheck help to detect and improve usability problems on your website.