Home  >  Article  >  Web Front-end  >  HTML specifies the attribute accesskey of the shortcut key that activates (makes the element focus)

HTML specifies the attribute accesskey of the shortcut key that activates (makes the element focus)

黄舟
黄舟Original
2017-11-03 09:34:452730browse

Example

Hyperlink with specified shortcut key:

<a href="http://www.w3school.com.cn/html/" accesskey="h">HTML</a><br />
<a href="http://www.w3school.com.cn/css/" accesskey="c">CSS</a>

Browser support

Almost all browsers have accesskey Properties , except Opera.

Definition and Usage

The accesskey attribute specifies the shortcut key for activating (making the element gain focus) the element.

Tips and Notes

Note: The following elements support the accesskey attribute: 3499910bf9dac5ae3c52d5ede7383485, 03fc64e1e502d5ba947b3a9af06d2d2a, bb9345e55eb71822850ff156dfde57c8, d5fd7aea971a85678ba271703566ebfd, < ;label>, e911751791aa3ba95dc724e2fb905976 and 4750256ae76b6b9d804861d8f69e79d3.

Syntax

<element accesskey="character">

Attribute value

Value Description
character Specifies a convenience key that activates (brings focus to) an element.

How to use accesskey shortcut keys in various browsers

IE browser

Hold down Alt key, click the shortcut key defined by accesskey (the focus will move to the link), and then press Enter.

FireFox Browser

Hold down the Alt+Shift key, and click the shortcut key defined by accesskey.

Chrome Browser

Hold down the Alt key and click the shortcut key defined by accesskey.

Opera Browser

Hold down the Shift key and click esc, A list of accesskey shortcut keys defined on this page appears for selection.

Safari browser

Hold down the Alt key and click the shortcut key defined by accesskey.


The above is the detailed content of HTML specifies the attribute accesskey of the shortcut key that activates (makes the element focus). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn