In JavaScript, the animationiteration event fires when one iteration of a CSS Animation ends and another begins (MDN). It does not fire with animationend, and it does not fire when animation-iteration-count is 1.
Register a listener with addEventListener. Check readiness and browser support before you rely on this event.
Syntax
Listen for animationiteration. Start with this line.
JavaScript
el.addEventListener("animationiteration", fn)
Call
What it does
el.addEventListener("animationiteration", fn)
Primary signature.
Built into the browser. Listen with el.addEventListener("animationiteration", …) — no import required.
Library declarations
JavaScript
el.addEventListener("animationiteration", fn)
Parameters
Parameter
Description
CSS animation
Required. Must actually run keyframes
Iteration count > 1
Required. Otherwise no loop boundary
Return Value
Return Value
Description
*
Fires as an Element event (listener receives the Event object).
animationend
/* no animationiteration for count: 1 */
How It Works
Use count 1. Only one cycle — no “next” loop.
Listen for both events. Iteration stays silent.
See animationend only (after animationstart).
Raise the count in Try It Yourself to see iteration events appear.
Compatibility
Browser Support
Element.animationiteration is marked Baseline Widely available on MDN (since December 2019). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline · Widely available
Element animationiteration
Fires between CSS animation iterations — not on the final animationend.
WidelyAvailable
Google ChromeFull support · Desktop & Mobile
Full support
Mozilla FirefoxFull support · Desktop & Mobile
Full support
Apple SafariFull support · macOS & iOS
Full support
Microsoft EdgeFull support · Chromium
Full support
OperaFull support · Modern versions
Full support
Internet ExplorerLegacy with prefixes historically
Partial support
animationiterationBaseline support
Bottom line: Safe for modern browsers. Use animation-iteration-count greater than 1, listen for animationiteration, and use animationend for the final finish. See the MDN Element animationiteration reference.
Frequently Asked Questions
It fires when one iteration of a CSS Animation ends and another iteration begins (MDN). It does not fire at the same time as animationend, and it does not fire for animations whose animation-iteration-count is one.
No. MDN marks Element animationiteration as Baseline Widely available (since December 2019). It is not Deprecated, Experimental, or Non-standard.
An AnimationEvent. Useful read-only properties include animationName, elapsedTime, and pseudoElement.
Use element.addEventListener("animationiteration", handler) or set element.onanimationiteration = handler. Prefer addEventListener when you need multiple handlers or easy removal.
Because there is no next iteration after the only cycle. With animation-iteration-count: 1, you get animationstart and then animationend — no animationiteration in between.
animationiteration marks the boundary between loops while the animation continues. animationend fires once when the entire animation (including the last iteration) has finished.