HTML accesskey Attribute

 Night Mode  Light Mode

 

Definition and Usage

The accesskey attribute is a is a global attribute. It provides the keyboard shortcut for an element.

When user pressed the element accesskey, he will reach automatically on the required element in the webpage.
 

Example :

<a href="https://www.webplover.com/" accesskey="x">Home</a>
<br>
<p accesskey="y">Paragraph</p>
<br>
<h3 accesskey="z">Heading</h3>

 

Result

Home

Paragraph

Heading

 

In the above example

  1. With pressing the ‘x’ accesskey, user will reach on the given above Home link.
  2. With pressing the ‘y’ accesskey, user will reach on the given above Paragraph.
  3. With pressing the ‘z’ accesskey, user will reach on the given above Heading.

The using method of the accesskey attribute in varying browsers is different.

Browser Windows Mac
Google Chrome Alt + accesskey Control + Alt + accesskey
Firefox Alt + Shift + accesskey Control + Alt + accesskey
Internet Explorer Alt + accesskey N/A
Opera Alt + accesskey Control + Alt + accesskey
Safari Alt + accesskey Control + Alt + accesskey

Here are a few tutorials for you to read next:

If you find this tutorial helpful, then please Subscribe to our YouTube Channel for video tutorials, and share this article on social media.

Was this post helpful?

Leave a Comment

Your email address will not be published. Required fields are marked *