HTML Dom accesskey attribute definition and usage

Source: Internet
Author: User
You can set the accesskey attribute or return the keyboard buttons for accessing a button. The accesskey is the shortcut key provided by the web page. Generally, ALT + key is used for selection. However, browsers are not the same. The IE series uses Alt + key, and the entet is added to the crash (if the link is used .) In ff2.0 or lower, ALT + key is also used. However, if the link is used, it is opened directly. In Netscape, ALT + key is also directly pressed. In ff2.0, the official website said: the access key provided by the webpage should be Alt + Shift + key on windows, just like Suse, in Mac OS X, it is Ctrl + key, while in UNIX, It is Ctrl + Shift + key. In addition to Alt + key, you need to press multiple keys to avoid conflicts with the browser. The idea is good, but it is not convenient to press one hand. In opera, press SHIFT + ESC to activate the accesskey panel.

After knowing how to operate the accesskey, let's take a look at the following example:

As shown in the following figure, select the link "Alt + B" in IE browser and press enter to open the link in a new window.

<A href = "everestdesign.cn" target = "_ blank"> everestdesign.cn "target =" _ blank "rel =" external "> http://www.everestdesign.cn" target = "_ blank"> everestdesign.cn "accesskey = "B" target = "_ blank"> Everest design </a>

The accesskey value can be a combination of letters and numbers. Some browsers do not solve the key conflicts between webpages and browsers. Therefore, not all letters are suitable for use. At the same time, some browser numbers cannot use the numbers in the keypad. For example, FF, if a person uses the accesskey provided by others on the webpage, theoretically he will also use the browser to complete some operations. Of course, this is just my personal idea and I don't know if others are doing the same. Maybe, like me, Internet Explorer is only used to debug webpages.

The accesskey has the highest priority and can block the shortcut keys of the browser. But what is the result of pressing Alt + H on a webpage without such an accesskey? Do not conflict with tools such as IE. Here we will list the default combination: IE: A (favorites) D (Address) E (edit) f (File) H (HELP) T (tools) V (View) Firefox: B (bookmark) D (Address) E (edit) f (File) g (goto) H (HELP) T (tools) V (view)

Accesskey is usually used for forms, and the key range is large.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.