Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML button autofocus attribute

HTML

HTML button Tag Reference HTML

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Firefox, Chrome, and Safari support the autofocus attribute.

Note: Internet Explorer 9 and earlier IE versions do not support the autofocus attribute.


Definition and Usage

The autofocus attribute is a boolean attribute.

The autofocus attribute specifies that the button should automatically gain focus when the page loads.


Differences between HTML 4.01 and HTML5

The autofocus attribute is new in HTML5