Home  >  Article  >  Web Front-end  >  Introduction and application of html5 button autofocus attribute_html5 tutorial skills

Introduction and application of html5 button autofocus attribute_html5 tutorial skills

WBOY
WBOYOriginal
2016-05-16 15:50:432093browse

In HTML 5, you can set the automatic focus to reach a certain control when the page is loaded. This is the autofocus attribute, as follows:

Copy code
The code is as follows:





The browsers that support this attribute are :
fiefox 4, safari 5, Chrome 6, Opera 11, IE 10, and Android 2.3 and Safari Mobile 5- do not support

instance
When the page loads, a button will get focus:

Copy code
The code is as follows:



Try it for yourself
Definition and usage
The autofocus attribute specifies that the button should automatically Get focus.

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

Copy code
The code is as follows:

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