W3cubDocs

/Web APIs

Animation: id property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨March 2020⁩.

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

Value

A string which can be used to identify the animation, or null if the animation has no id.

Examples

In the Red Queen's Race Game example, you can assign the redQueenAlice an id like so:

redQueenAlice.id = "redQueenAlice";

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
id 75 79 48 62 13.1 75 48 54 13.4 11.0 75 13.4

See also

© 2005–2025 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