Animation.id

Baseline 2022

Newly available

Since September 2022, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

La propiedad Animation.id de la Web Animations API (en-US) devuelve o establece una cadena(string) utilizado para identificar la animación.

Sintaxis

js
var animationsId = Animation.id;

Animation.id = newIdString;

Valor

Un DOMString que se puede usar para identificar la animación, o null si la animación no tiene id.

Ejemplos

En el ejemplo Follow the White Rabbit, puedes asignar a rabbitDownAnimation un id de esta manera:

js
rabbitDownAnimation.effect.id = "rabbitGo";

Especificaciones

Specification
Web Animations
# dom-animation-id

Compatibilidad con navegadores

BCD tables only load in the browser

Ver también