HTML DOM accessKey 屬性
定義和用法
accessKey 屬性可設(shè)置或返回訪(fǎng)問(wèn)一個(gè)鏈接的鍵盤(pán)按鍵。
注釋?zhuān)?/span>請(qǐng)使用 Alt + accessKey 為擁有指定快捷鍵的元素賦予焦點(diǎn)。
語(yǔ)法
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>