当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM accessKey 属性

HTML DOM
DOM TableRow 对象
DOM Textarea 对象
DOM Window 对象

HTML DOM accessKey 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 467 ::
收藏到网摘: n/a

定义与用法

The accessKey property sets or returns a keyboard key to access a link.
accessKey 属性可以用来设置或是返回用键盘所访问的连接。

Note: Use Alt + accessKey to give focus to the elements with a specified access key.
注意:通过指定access key 可以使用Alt+accessKey来聚焦某个元素

语法

anchorObject.accessKey=accessKey


举例

<html>
<head>
<script type="text/javascript">
function access()
{
document.getElementById('myAnchor').accessKey="a"

}
</script>
</head>

<body onload="access()">
<p><a id="myAnchor" href="http://www.ruanchen.com">
Visit ruanchen.com</a></p>

</body>

</html>


尝试与演示

Add an accessKey to a link
为连接加上accessKey

评论 (0) All

登陆 | 还没注册?