UK [ˈækses ki:] US [ˈæksɛs ki]

Access Keywords

javascript accessKey attribute syntax

Function:Sets or returns the keyboard keys used to access a link.

Note: Please use Alt accessKey to give focus to the element with the specified shortcut key.

javascript accessKey attribute example

<html>
<head>
    <meta charset="UTF-8">
    <script type="text/javascript">
        function accesskey()
        {
            document.getElementById('php').accessKey="w"
            document.getElementById('course').accessKey="d"
        }
    </script>
</head>

<body onload="accesskey()">

<p><a id="php" href="http://www.php.cn/">php中文网</a> (请使用 Alt + w 给该链接赋予焦点)</p>
<p><a id="course" href="http://www.php.cn/course/">教程</a> (请使用 Alt + d 为该链接赋予焦点)</p>

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance