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.
var animationsId = Animation.id; Animation.id = newIdString;
A DOMString 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:
rabbitDownAnimation.effect.id = "rabbitGo";
| Specification | Status | Comment |
|---|---|---|
| Web Animations The definition of 'Animation.id' in that specification. | Working Draft | Editor's draft. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 50 | ? | 48
|
No | 37 | No |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | 50 | 50 | ? | 48
|
37 | No | 5.0 |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Animation/id