html.global_attributes.autofocus

Spec

MDN URL

Status

On the standards track: Yes

Is Experimental: No

Is Deprecated: No

Browser Support

In Chrome version 79 on 2019-12-10 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Chrome Android version 79 on 2019-12-17 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Edge version 79 on 2020-01-15 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Firefox version 110 on 2023-02-14 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Firefox for Android version 110 on 2023-02-14 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Internet Explorer version 10 on 2012-10-26 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Quest Browser version 8.0 on undefined Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Opera version 66 on 2020-01-07 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Opera Android version 57 on 2020-03-30 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Safari version 15.4 on 2022-03-14 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In Safari on iOS version 16.4 on 2023-03-27 Note: If there's no hardware keyboard connected, then the autofocus attribute has no effect (for example, the focus event doesn't fire and the element does not match the :focus selector).

In Samsung Internet version 12.0 on 2020-06-19 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In WebView Android version 79 on 2019-12-17 Note: Supported for the <button>, <input>, <select>, and <textarea> elements.

In WebView on iOS version 16.4 on 2023-03-27 Note: If there's no hardware keyboard connected, then the autofocus attribute has no effect (for example, the focus event doesn't fire and the element does not match the :focus selector).