DEV Community

Kahlil Lechelt
Kahlil Lechelt

Posted on • Originally published at on



While working on improving accessibility features of an application I learned about an HTML feature that I was not aware of before: the accesskey attribute.

The attribute allows you to add keyboard shortcuts to an element.

In order to assign a keyboard shortcut you add the accesskey attribute to an element and assign it a letter. For instance the letter “a”, like this:

<div accesskey="a"> ... </div>
Enter fullscreen mode Exit fullscreen mode

This automatically binds a shortcut to the element that either focuses it or triggers a click event.

The actual shortcut varies between browsers and platforms but in general in modern browsers it is alt + a for Windows and Linux and alt + ctrl + a on the Mac and alt + shift + a on Windows and Linux on Firefox.

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git