A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/zh-CN/docs/Web/HTML/Reference/Global_attributes/accesskey below:

accesskey - HTMLï¼ˆè¶…æ–‡æœ¬æ ‡è®°è¯è¨€ï¼‰ | MDN

accesskey

Baseline Widely available

accesskey 全局属性 提供了为当前元素生成快捷键的方式。属性值必须包含一个可打印字符。

尝试一下
<p>If you need to relax, press the <b>S</b>tress reliever!</p>
<button accesskey="s">Stress reliever</button>
b {
  text-decoration: underline;
}

备注: 在 WHATWG 规范中,它说你可以指定多个空格分隔的字符,浏览器将使用它所支持的第一个字符。然而,这在大多数浏览器中是行不通的。在 IE/Edge 中,它将使用它支持的第一个没有问题的,只要没有与其他命令冲突。

激活 accesskey 的操作取决于浏览器及其平台。

Windows Linux Mac Firefox Alt + Shift + key On Firefox 57 or newer, Control + Option + key -OR- Control + Alt + key
On Firefox 14 or newer, Control + Alt + key
On Firefox 13 or older, Control + key Internet Explorer Alt + key N/A Google Chrome Alt + key Control + Alt + key Safari Alt + key N/A Control + Alt + key Opera 15+ Alt + key Control + Alt + key Opera 12

Shift + Esc opens a contents list which are accessible by accesskey, then, can choose an item by pressing key

要注意 Firefox 可以通过用户偏好,自定义所需的修饰键。

无障碍

除了糟糕的浏览器支持之外, accesskey属性还有很多问题:

由于这些问题,一般建议不要在大多数通用的网站和 web 应用程序中使用accesskey 属性。

规范 浏览器兼容性 参见

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4