SVGElement

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

* Some parts of this feature may have varying levels of support.

All of the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the SVGElement interface.

EventTarget Node Element SVGElement

Instance properties

Also inherits properties from the Element interface.

SVGElement.attributeStyleMap Read only

A StylePropertyMap representing the declarations of the element's style attribute.

SVGElement.autofocus

Whether the control should be focused when the page loads, or when a <dialog> or popover become shown.

SVGElement.className Read only

An SVGAnimatedString that reflects the value of the class attribute on the given element, or the empty string if class is not present. This attribute is deprecated and may be removed in a future version of this specification. Authors are advised to use Element.classList instead.

SVGElement.dataset Read only

A DOMStringMap object which provides a list of key/value pairs of named data attributes which correspond to custom data attributes attached to the element. These can also be defined in SVG using attributes of the form data-*, where * is the key name for the pair. This works just like HTML's HTMLElement.dataset property and HTML's data-* global attribute.

SVGElement.nonce

Returns the cryptographic number used once that is used by Content Security Policy to determine whether a given fetch will be allowed to proceed.

SVGElement.ownerSVGElement Read only

An SVGSVGElement referring to the nearest ancestor <svg> element. null if the given element is the outermost <svg> element.

SVGElement.style

A CSSStyleDeclaration representing the declarations of the element's style attribute.

SVGElement.tabIndex

The position of the element in the tabbing order.

SVGElement.viewportElement Read only

The SVGElement which established the current viewport. Often the nearest ancestor <svg> element. null if the given element is the outermost <svg> element.

Instance methods

This interface also inherits methods from Element.

SVGElement.blur()

Removes keyboard focus from the currently focused element.

SVGElement.focus()

Makes the element the current keyboard focus.

Events

Listen to these events using addEventListener() or by assigning an event listener to the equivalent on... handler property.

abort

Fired when page loading is stopped before an SVG element has been allowed to load completely.

error

Fired when an SVG element does not load properly or when an error occurs during script execution.

load

Fires on an SVGElement when it is loaded in the browser.

resize

Fired when an SVG document is being resized.

scroll

Fired when an SVG document view is being shifted along the X and/or Y axes.

unload

Fired when the DOM implementation removes an SVG document from a window or frame.

Specifications

Specification
Scalable Vector Graphics (SVG) 2
# InterfaceSVGElement

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
SVGElement
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 1.5 (Release date: 2005-11-29)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Full support
Safari on iOS 1 (Release date: 2007-06-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 3 (Release date: 2011-02-22)
footnote Full support
WebView on iOS – Full support
WebView on iOS 1 (Release date: 2007-06-29)
footnote Full support
attributeStyleMap
Chrome – Full support
Chrome 66 (Release date: 2018-04-17)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote
footnote See bug 1278697
Opera – Full support
Opera 53 (Release date: 2018-05-10)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 66 (Release date: 2018-04-17)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1278697
Opera Android – Full support
Opera Android 47 (Release date: 2018-07-23)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 9 (Release date: 2018-09-15)
footnote Full support
WebView Android – Full support
WebView Android 66 (Release date: 2018-04-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
autofocus
Chrome – Full support
Chrome 79 (Release date: 2019-12-10)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Partial support
Firefox 78 – 109 (Release date: 2020-06-30)
footnote Partial support
footnote Only supported on SVGGraphicsElement.
Firefox – Full support
Firefox 110 (Release date: 2023-02-14)
footnote Full support
Opera – Full support
Opera 66 (Release date: 2020-01-07)
footnote Full support
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Chrome Android – Full support
Chrome Android 79 (Release date: 2019-12-17)
footnote Full support
Firefox for Android – Partial support
Firefox for Android 79 – 109 (Release date: 2020-07-28)
footnote Partial support
footnote Only supported on SVGGraphicsElement.
Firefox for Android – Full support
Firefox for Android 110 (Release date: 2023-02-14)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Samsung Internet – Full support
Samsung Internet 12 (Release date: 2020-06-19)
footnote Full support
WebView Android – Full support
WebView Android 79 (Release date: 2019-12-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
blur
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 51 (Release date: 2017-01-24)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 51 (Release date: 2017-01-24)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 1 (Release date: 2007-06-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 1 (Release date: 2007-06-29)
footnote Full support
className
Deprecated
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 1.5 (Release date: 2005-11-29)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Full support
Safari on iOS 1 (Release date: 2007-06-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 3 (Release date: 2011-02-22)
footnote Full support
WebView on iOS – Full support
WebView on iOS 1 (Release date: 2007-06-29)
footnote Full support
dataset
Chrome – Full support
Chrome 55 (Release date: 2016-12-01)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 51 (Release date: 2017-01-24)
footnote Full support
Opera – Full support
Opera 41 (Release date: 2016-10-25)
footnote Full support
Safari – Full support
Safari 5.1 (Release date: 2011-07-20)
footnote Full support
Chrome Android – Full support
Chrome Android 55 (Release date: 2016-12-06)
footnote Full support
Firefox for Android – Full support
Firefox for Android 51 (Release date: 2017-01-24)
footnote Full support
Opera Android – Full support
Opera Android 41 (Release date: 2016-10-25)
footnote Full support
Safari on iOS – Full support
Safari on iOS 5 (Release date: 2011-10-12)
footnote Full support
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Full support
WebView Android 55 (Release date: 2016-12-06)
footnote Full support
WebView on iOS – Full support
WebView on iOS 5 (Release date: 2011-10-12)
footnote Full support
error event
Chrome – Full support
Chrome 10 (Release date: 2011-03-08)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 1.5 (Release date: 2005-11-29)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 6 (Release date: 2012-07-25)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Full support
Safari on iOS 6 (Release date: 2012-09-10)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 6 (Release date: 2012-09-10)
footnote Full support
focus
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 51 (Release date: 2017-01-24)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 51 (Release date: 2017-01-24)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 1 (Release date: 2007-06-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 1 (Release date: 2007-06-29)
footnote Full support
options.preventScroll parameter
Chrome – Full support
Chrome 78 (Release date: 2019-10-22)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 68 (Release date: 2019-07-09)
footnote Full support
Opera – Full support
Opera 65 (Release date: 2019-11-13)
footnote Full support
Safari – Full support
Safari 15 (Release date: 2021-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 78 (Release date: 2019-10-22)
footnote Full support
Firefox for Android – Full support
Firefox for Android 68 (Release date: 2019-07-09)
footnote Full support
Opera Android – Full support
Opera Android 56 (Release date: 2020-02-06)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.5 (Release date: 2022-05-16)
footnote Full support
Samsung Internet – Full support
Samsung Internet 12 (Release date: 2020-06-19)
footnote Full support
WebView Android – Full support
WebView Android 78 (Release date: 2019-10-22)
footnote Full support
WebView on iOS – Full support
WebView on iOS 15.5 (Release date: 2022-05-16)
footnote Full support
load event
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 4 (Release date: 2011-03-22)
footnote , altname
altname Alternate name: SVGLoad
footnote See bug 620002 for implementation status of the standard load event.
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote , altname
altname Alternate name: SVGLoad
footnote See bug 620002 for implementation status of the standard load event.
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Full support
Safari on iOS 1 (Release date: 2007-06-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 1 (Release date: 2007-06-29)
footnote Full support
nonce
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 75 (Release date: 2020-04-07)
footnote Full support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – Full support
WebView Android 61 (Release date: 2017-09-05)
footnote Full support
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
ownerSVGElement
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 1.5 (Release date: 2005-11-29)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Full support
Safari on iOS 1 (Release date: 2007-06-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 3 (Release date: 2011-02-22)
footnote Full support
WebView on iOS – Full support
WebView on iOS 1 (Release date: 2007-06-29)
footnote Full support
style
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 1.5 (Release date: 2005-11-29)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Full support
Safari on iOS 1 (Release date: 2007-06-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 1 (Release date: 2007-06-29)
footnote Full support
Returns CSSStyleProperties (not CSSStyleDeclaration)
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 145 (Release date: 2025-11-11)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 145 (Release date: 2025-11-11)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
tabIndex
Chrome – Full support
Chrome 36 (Release date: 2014-07-16)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 51 (Release date: 2017-01-24)
footnote Full support
Opera – Full support
Opera 23 (Release date: 2014-07-22)
footnote Full support
Safari – Full support
Safari 8 (Release date: 2014-10-16)
footnote Full support
Chrome Android – Full support
Chrome Android 36 (Release date: 2014-07-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 51 (Release date: 2017-01-24)
footnote Full support
Opera Android – Full support
Opera Android 24 (Release date: 2014-09-10)
footnote Full support
Safari on iOS – Full support
Safari on iOS 8 (Release date: 2014-09-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 3 (Release date: 2015-04-10)
footnote Full support
WebView Android – Full support
WebView Android 37 (Release date: 2014-09-03)
footnote Full support
WebView on iOS – Full support
WebView on iOS 8 (Release date: 2014-09-17)
footnote Full support
viewportElement
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 1.5 (Release date: 2005-11-29)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Full support
Safari on iOS 1 (Release date: 2007-06-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 3 (Release date: 2011-02-22)
footnote Full support
WebView on iOS – Full support
WebView on iOS 1 (Release date: 2007-06-29)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Deprecated. Not for use in new websites.
See implementation notes.
Uses a non-standard name
Has more compatibility info.

See also