This example uses the addEventListener() method to attach an "animationstart" and "animationiteration" event to a DIV element.
The elapsedTime property returns the number of seconds the animation has been running: