W3cubDocs

/Web APIs

SVGElement: autofocus property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨February 2023⁩.

The autofocus property of the SVGElement interface contains a boolean value reflecting the autofocus HTML global attribute. It indicates whether the SVG element should be focused when the page loads or when the element becomes shown if the SVG element is inside a <dialog> or a popover.

Value

A boolean value.

Specifications

Specification
HTML>
# dom-fe-autofocus>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
autofocus 79 79 110
78–110Only supported on SVGGraphicsElement.
66 15.4 79 110
79–110Only supported on SVGGraphicsElement.
57 15.4 12.0 79 15.4

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/autofocus