Animation.id

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Animation.id property of the Web Animations API returns or sets a string used to identify the animation.

Syntax

var animationsId = Animation.id;

Animation.id = newIdString;

Value

A DOMString which can be used to identify the animation, or null if the animation has no id.

Examples

In the Follow the White Rabbit example, you can assign the rabbitDownAnimation an id like so:

rabbitDownAnimation.effect.id = "rabbitGo";

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
id
50
79
48
No
37
13.1
50
50
48
37
13.4
5.0

See also

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