Html5buttonautofocus attribute introduction and _ html5 tutorial skills-

Source: Internet
Author: User
In html5, you can set the automatic focus to reach a certain control when the page is loaded. This is the autofocus attribute. Next, let's take a look at it in html 5, you can set the automatic focus to reach a control when the page is loaded. This is the autofocus attribute, as shown below:

The Code is as follows:



Hi!


The browser supports the following attributes::
Fiefox 4 +, safari 5 +, chrome 6 +, opera 11 +, ie 10, not supported by android 2.3 and safari mobile 5

Instance
When a page is loaded, a button with the focus will be obtained:

The Code is as follows:



Click here


Try it yourself
Definition and usage
The autofocus attribute specifies that when a page is loaded, the button should automatically obtain the focus.

If this attribute is used, the button gets the focus.
Differences between HTML 4.01 and HTML 5
The autoplay attribute is a new attribute in HTML 5.
Syntax

The Code is as follows:


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.