W3cubDocs

/DOM

Animation.id

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

See also

© 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