HTML onanimationstart Event Attribute
Description
The onanimationstart event attribute runs a script when a CSS animation starts, after any animation-delay has passed. If the delay is negative, it fires straight away with an elapsedTime equal to the skipped time.
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 onanimationstart="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 onanimationstart event attribute. Hover over a browser icon to see the version that first introduced support for this HTML event attribute.
Desktop





Tablets & Mobile





