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

HTML select autofocus attribute

HTML tag

Example

A drop-down list that automatically gains focus:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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

**Note:** Firefox or Internet Explorer 9 and earlier versions do not support the for the tag.


Differences between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the autofocus attribute must be defined as


HTML select Tag Reference HTML