Skip to content
Related Articles

Related Articles

Improve Article
HTML | <button> autofocus Attribute
  • Last Updated : 29 Apr, 2019

The HTML | <button> autofocus Attribute is used to specifies that the button should get automatically get focus or not when the page loads. It is a Boolean Attribute.


<button type="button" autofocus> 

Example: This Example illustrates the use of autofocus attribute in Button Element.

<!DOCTYPE html>
        HTML | 
      <button>autofocus Attribute
<body style="text-align:center">
    <h1 style="color: green;"
        HTML |  
      <button>autofocus Property 
    <!-- Assign id to the Button. -->
    <button id="GFG"


Supported Browsers: The browser supported by HTML | <button>autofocus Attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari
My Personal Notes arrow_drop_up
Recommended Articles
Page :