A button with autofocus:
![]()
The autofocus attribute is supported in Internet Explorer 10, Firefox, Chrome, and Safari.
Note: The autofocus attribute is not supported in Internet Explorer 9 and earlier versions.
The autofocus attribute is a boolean attribute.
When present, it specifies that a button should automatically get focus when the page loads.
The autofocus attribute is new for the <button> tag in HTML5.
In XHTML, attribute minimization is forbidden, and the autofocus attribute must be defined as <button autofocus="autofocus">.
HTML <button> tag
Your message has been sent to W3Schools.