dom / latest / animation / id.html /

Animation.id

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

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
75
79
48
No
62
13.1
75
75
48
54
13.4
11.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