The Animation.id property of the Web Animations API returns or sets a string used to identify the animation.
The Animation.id property of the Web Animations API returns or sets a string used to identify the animation.
A string which can be used to identify the animation, or null if the animation has no id.
In the Follow the White Rabbit example, you can assign the rabbitDownAnimation an id like so:
js
rabbitDownAnimation.id = "rabbitGo";
| Specification | 
|---|
| Web Animations  # dom-animation-id  | 
| 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 | 
    © 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/Animation/id