HTML onanimationend Event Attribute
Description
The onanimationend event attribute runs a script when a CSS animation finishes all of its iterations. It does not fire if the animation is removed before it ends (that fires animationcancel), and it never fires for animations with animation-iteration-count: infinite. It is often used to remove a class or element after an exit animation.
The event is an AnimationEvent with the properties animationName (the name of the @keyframes rule), elapsedTime (in seconds, not counting animation-delay) and pseudoElement (for example "::before"). Animation events bubble, so one handler on a parent can watch all of its children; check event.target to see which element is animating.
Syntax
<element onanimationend="script">
Values
- scriptThe name of the script to use when the event has been triggered.
Example
Browser Support
The following information will show you the current browser support for the HTML onanimationend event attribute. Hover over a browser icon to see the version that first introduced support for this HTML event attribute.
Desktop





Tablets & Mobile





