Skip to content
SilktideHelp

Accesskey attribute

Silktide finds elements that declare an accesskey, an old way of giving an element its own keyboard shortcut. These shortcuts are always active and cannot be turned off by the visitor, which causes more problems than it solves.

Why this matters

The accesskey attribute in creates a single-character keyboard shortcut that fires whenever the key is pressed. That collides with how many people already use their keyboard: users and browsers reserve overlapping key combinations, so an accesskey can silently override a shortcut someone depends on - and which key combination triggers it varies by browser and operating system. People who type with speech input or have low dexterity can also fire the shortcut accidentally.

success criterion 2.1.4 (Character Key Shortcuts, level A) requires that single-character shortcuts can be turned off, remapped, or only fire while the element has . An accesskey satisfies none of these: it is always on, and only the site can change it.

How to fix it

  1. Remove the accesskey attribute. It rarely provides real value, and its removal changes nothing visible on the page.
<!-- Always-on shortcut that can conflict with the user's own -->
<a href="\/search" accesskey="s">Search</a>

<!-- Fixed: a normal link, reachable with Tab like everything else -->
<a href="\/search">Search</a>
  1. If you genuinely need keyboard shortcuts, implement them so the visitor can disable or remap them, or so they only apply while the relevant control is focused.

How Silktide tests this

  1. Find every element in the page's HTML that declares an accesskey attribute with a non-empty value.
  2. Report each one. Empty values (accesskey="") are ignored, since some component libraries render the attribute as a no-op and it creates no shortcut.

Troubleshooting

We added accesskeys to improve accessibility

That was once recommended advice, but experience showed the conflicts with browser and shortcuts outweigh the benefit, and modern guidance is to avoid the attribute. Well-structured pages with good headings and landmarks serve keyboard users better.

Shortcuts implemented in JavaScript

This check only covers the accesskey attribute. Shortcuts implemented in script are covered by Character key shortcuts; the two checks are complementary and may both appear on the same page.

Learn more

Last updated

Was this page helpful?