The Element.getAnimations() method returns an array of Animation objects that affect this element now, or are scheduled to (MDN). That includes CSS animations, CSS transitions, and Web Animations from animate().
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call el.getAnimations. Start with this line.
JavaScript
el.getAnimations(options?)
Call
What it does
el.getAnimations(options?)
Primary signature.
el.getAnimations(...)
Call with the arguments your case needs.
Built into the browser. Call getAnimations(...) on an Element — no import required.
Library declarations
JavaScript
el.getAnimations(options?)
Parameters
Parameter
Description
options.subtree
Optional. true = include descendants (default false)
options.pseudoElement
Optional. Target like "::after"
Return Value
Return Value
Description
*
Animation[]
JavaScript Examples
Example 1 — Count Animations
Start a Web Animation, then ask how many are on the element.
Start a finite animation. Duration ends → finished settles.
Use subtree: true. Include child animations too (MDN).
Map to finished. Each promise resolves when that animation ends.
Then continue. Safe place to remove nodes or update UI.
Compatibility
Browser Support
Element.getAnimations() is Baseline Widely available on MDN (across browsers since July 2020). It is not Deprecated, Experimental, or Non-standard. Some option details (for example pseudoElement) may vary — check your target browsers.
✓ Baseline Widely available
Element.getAnimations()
List CSS and Web Animations affecting an element. Widely available since 2020.
2020+Widely available
Google Chrome84+
Supported
Mozilla Firefox75+
Supported
Apple Safari13.1+
Supported
Microsoft Edge84+
Supported
Opera70+
Supported
Internet ExplorerNot supported
Unavailable
getAnimations()Baseline
Bottom line: Safe for modern browsers. Pair with animate() to create, then getAnimations() to inspect and control.
Frequently Asked Questions
It returns an array of Animation objects that currently affect the element, or are scheduled to (MDN). This includes CSS animations, CSS transitions, and Web Animations from animate().
No. MDN marks Element.getAnimations() as Baseline Widely available (across browsers since July 2020). It is not Deprecated, Experimental, or Non-standard.
An array of Animation instances. An empty array means nothing matches your options right now.
Pass { subtree: true } to also include animations on descendants and their pseudo-elements. Defaults to false (MDN).
animate() creates and plays a new animation. getAnimations() lists animations already affecting the element so you can pause, cancel, or await animation.finished.
The document-level method returns all animations in the document. Element.getAnimations() is scoped to one element (plus optional subtree).