[accesskey] values are not unique
How to fix the accesskeys accessibility rule. Keyboard. A best practice, not a WCAG requirement.
The message you saw
Lighthouse runs axe-core inside it, so both are the same check, and the fix below works whichever tool showed you the message.
What it means
The accesskey attribute gives an element a keyboard shortcut, such as Alt+S to jump to the search box. This message means two or more elements on the page use the same key (axe-core compares them ignoring upper and lower case), so the shortcut is ambiguous: browsers handle it differently, and some only reach the first one.
It’s a best practice from axe-core, not a WCAG requirement on its own.
Who is affected
Two or more elements use the same accesskey shortcut, so the key goes to the wrong place or does nothing.
Keyboard users who know and use the shortcut. With a duplicate, the key takes them to the wrong place or does nothing they expect. Access keys can also clash with shortcuts in the browser or in screen readers, which is a reason many sites avoid them.
How to find it
- Run the checker; it lists the duplicate key and every element that uses it.
- In the browser console, run
[...document.querySelectorAll('[accesskey]')].map(e => e.accessKey)to see all keys used.
How to fix it
- Give each element its own key, or remove the duplicates.
- Ask whether you need access keys at all. They’re hard to discover, the modifier keys differ between browsers and systems, and they can override shortcuts people rely on. Removing them is often the cleanest fix.
- If you keep them, tell people what they are on the page (for example on an accessibility page).
Example
Before
<a href="/" accesskey="h">Home</a>
<a href="/help" accesskey="h">Help</a>After
<a href="/">Home</a>
<a href="/help">Help</a>Common mistakes
- Hidden elements are ignored, so a duplicate on a hidden menu only shows up when the menu is visible during the scan.
WCAG success criteria
None. This is a best practice: fixing it helps people using assistive technology, but it doesn’t affect WCAG conformance. Our scanner only reports it if you tick “Also show best-practice suggestions”.
Check your fix
Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools. Scan again after your change: when the rule no longer appears under the problems, the fix worked.
An automated pass means this rule found nothing wrong. It doesn’t prove the page is accessible: some of what WCAG asks for needs a person to check, and the report’s manual checklist lists those steps.
Related fix guides
More detail
- Deque University’s reference for accesskeys (the makers of axe-core, the engine our scanner uses)
- All fix guides