HTML DOM accessKey 屬性
定義和用法
accessKey 屬性可設(shè)置或返回訪問一個鏈接的鍵盤按鍵。
注釋:請使用 Alt + accessKey 為擁有指定快捷鍵的元素賦予焦點(diǎn)。
語法
anchorObject.accessKey=accessKey
實(shí)例
下面的例子將為鏈接設(shè)置快捷鍵:
<html>
<head>
<script type="text/javascript">
function accesskey()
{
document.getElementById('w3').accessKey="w"
}
</script>
</head>
<body onload="accesskey()">
<a id="w3" href="http://www.dbjr.com.cn/">jb51.net</a>
</body>
</html>