SVGAnimationElement: endEvent event

The endEvent event of the SVGAnimationElement interface is fired when at the active end of the animation is reached.

Note: This event is not raised at the simple end of each animation repeat. This event may be raised both in the course of normal (i.e. scheduled or interactive) timeline play, as well as in the case that the element was ended with a DOM method.

Bubbles No
Cancelable No
Interface TimeEvent
Event handler property onend


Animated circle

<svg xmlns="" width="300px" height="100px">
  <title>SVG SMIL Animate with Path</title>
  <circle cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1">
       path="M 0 0 H 300 Z"
       dur="5s" repeatCount="indefinite" />


<button>Stop animation</button>


ul {
  height: 100px;
  border: 1px solid #ddd;
  overflow-y: scroll;
  padding: 10px 30px;
let svgElem = document.querySelector('svg');
let animateElem = document.querySelector('animateMotion');
let list = document.querySelector('ul');
let btn = document.querySelector('button');

animateElem.addEventListener('beginEvent', () => {
  let listItem = document.createElement('li');
  listItem.textContent = 'beginEvent fired';

animateElem.addEventListener('endEvent', () => {
  let listItem = document.createElement('li');
  listItem.textContent = 'endEvent fired';

animateElem.addEventListener('repeatEvent', (e) => {
  let listItem = document.createElement('li');
  let msg = 'repeatEvent fired';
  if(e.detail) {
    msg += '; repeat number: ' + e.detail;
  listItem.textContent = msg;

btn.addEventListener('click', () => {
  btn.disabled = true;
  animateElem.setAttribute('repeatCount', '1');

Event handler property equivalent

Note that you can also create an event listener for the end event using the onend event handler property:

animateElem.onend = () => {
  console.log('endEvent fired');


Specification Status Comment
Scalable Vector Graphics (SVG) 2
The definition of 'endEvent' in that specification.
Candidate Recommendation Initial definition

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
endEvent eventChrome Full support YesEdge Full support 79Firefox Full support YesIE No support NoOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support Yes


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also