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
Specification | Status | Comment |
---|---|---|
Web Animations The definition of 'Animation.id' in that specification. |
Working Draft | Editor's draft. |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 50 | 48 (48) | No support | 37 | No support |
Feature | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 50 | 50 | 48 (48) | No support | 37 | No support |