HTML - attributes - accesskey

revision:


Content

"accesskey" attribute : specifies a keyboard shortcut syntax some examples


"accesskey" attribute : specifies a keyboard shortcut

top

It is used to activate/focus an element. Its lvalue must be a single character (a letter or a digit). The shortcut is varying in different browsers:


syntax

top

<element accesskey="character">

character: a single character that specifies the shortcut key to activate/focus the element.


some examples

top
use tab and "alt + key"
lwitters (key: l)
Wikipedia (key: w)
codes:
                    <a href="https://lwitters.com" accesskey="l">lwitters (key: l)</a><br>
                    <a href="https://wikipedia.com" accesskey="w">Wikipedia (key: w)</a>
                
If you need to relax, press the Stress reliever!
codes:
                    <a>If you need to relax, press the <strong><u>S</u></strong>tress reliever! /a>
                    <button accesskey="s">Stress reliever</button>