This rule disallows use of accesskey attributes.


accesskey attributes allow web developers to assign keyboard shortcuts to elements. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreader and keyboard only users create accessibility complications so to avoid complications, access keys should not be used.

How to use

module.exports = {
  rules: {
    "@html-eslint/no-accesskey-attrs": "error",

Rule Details

Examples of incorrect code for this rule:

<div accesskey="h"></div>

Examples of correct code for this rule:


Further Reading

  1. MDN: accesskey