W3cubDocs

/Web APIs

SVGElement: load event

The load event fires on an SVGElement when it is loaded in the browser, e.g. in the DOM in the case of an embedded <svg>. It is basically the same as the standard load DOM event.

This event is not cancelable and does not bubble.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

js

addEventListener("load", (event) => {});

onload = (event) => {};

Event type

A generic Event.

Examples

js

svgElem.addEventListener("load", () => {
  console.log("SVG loaded.");
});

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
load_event 1 12
4See bug 620002 for implementation status of the standard load event.
9 ≤12.1 3 ≤37 18
4See bug 620002 for implementation status of the standard load event.
≤12.1 1 1.0

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