Full-stack JavaScript path (15th) HTML5 focus extension (focus extension), html5

Source: Internet
Author: User

Full-stack JavaScript path (15th) HTML5 focus extension (focus extension), html5

HTML5 adds the focus management function. The focus of documents can be obtained through page loading, user input (usually by pressing the tab key), and the focus () function is called in the code.


The attributes and methods of the auxiliary management focus added by HTML5 include:

Document. activeElement attribute. This attribute points to the element that obtains the focus. The value during document loading is null. The document is loaded completely and saved as a reference to document. body.

Document. hasFocus () method to determine whether the document gets the focus.



The most important use of these two functions is to improve the accessibility of Web applications. A major sign of accessibility Web applications is the proper focus management, and it is a great progress to know which element has obtained the focus. We don't have to rely on speculation as we used.


Browsers that implement these two attributes include IE 4 +, Firefox 3 +, Safari 4 +, Chrome and Opera 8 +.


In html5 and button tags, the autofocus attribute automatically obtains the focus. What does it mean? You can see the difference by opening the following content in a browser that supports html5. After the page is loaded, click a space to directly click the button. Similar to <input type = 'text' autofocus/>, when a page is loaded, the cursor is automatically focused on this text box.
<Button autofocus> bbb </button>
<Button> aaa </button>
After HTML5 extensions are installed, why can't I use the server DW CS5 javascript code to prompt extensions? I don't know what version of DW you are using
DW CS5 itself supports HTML5 jQuery extension. The greennet version is available for download on CSDN. NET.

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.