Animation: id property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{ APIRef("Web Animations") }}

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:

js
redQueenAlice.id = "redQueenAlice";

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("KeyframeEffect")}}
  • Web Animations API
  • {{domxref("Animation")}}