Full stack JavaScript road (15) HTML5 Focus expansion (extension point)

Source: Internet
Author: User

HTML5 added to help manage focus product features, there are ways to obtain focus documents; Page load, user input (usually by tab bond). and invoke the Code focus () feature.


HTML5 new properties and methods to assist in the management of the focus:

Document.activeelement property, Element. The document load period value is null and the document is loaded and saved as a reference to document.body.

Document.hasfocus () method to determine whether a document has focus.



The two most important use of querying a file to learn that the element has focus and to determine whether the file has focus is to improve web accessibility applications. Handicapped-only web an important sign of application management is the correct focus, and you know which elements have the focus is a big step forward. We no longer need to rely on speculation like the past.


Be aware of browsers with two attributes ie 4+, Firefox, Safari 4+, Chrome and opera 8+.

Full stack JavaScript road (15) HTML5 Focus expansion (extension point)

Related Article

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.