File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5151- bom/ : 浏览器模型
5252- bom/same-origin.md : 同源限制
5353- bom/location.md : Location 对象,URL 对象,URLSearchParams 对象
54+ - elements/ : 网页元素接口
55+ - elements/a.md : <a>
Original file line number Diff line number Diff line change 1+ # <a > 元素
2+
3+ ` <a> ` 元素用来设置超级链接。除了网页元素的通用接口(` Node ` 接口、` Element ` 接口、` HTMLElement ` 接口),它还继承了` HTMLAnchorElement ` 接口和` HTMLHyperlinkElementUtils ` 接口。
4+
5+ ## HTMLAnchorElement 接口
6+
7+ ### 属性
8+
9+ ** (1)HTMLAnchorElement.accessKey**
10+
11+ ` accessKey ` 属性用来读写` <a> ` 元素的快捷键。
12+
13+ ``` javascript
14+ // HTML 代码如下
15+ // <a id="test" href="http://example.com">test</a>
16+ var a = document .getElementById (' a' );
17+ a .accessKey = ' k' ;
18+ ```
19+
20+ 上面代码设置` <a> ` 元素的快捷键为` k ` ,以后只要按下这个快捷键,浏览器就会跳转到` example.com ` 。
21+
22+ 注意,不同的浏览器在不同的操作系统下,唤起快捷键的功能键组合是[ 不一样] ( https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey ) 的。比如,Chrome 浏览器在 Linux 系统下,需要按下` Alt + k ` ,才会跳转到` example.com ` 。
23+
24+
You can’t perform that action at this time.
0 commit comments