This example uses the addEventListener() method to attach an "animationstart" and "animationiteration" event to a DIV element.
When the animation is repeated, the background color of DIV will be light blue.
In this example, the elapsedTime property returns the number of seconds the repeated animation has been running:
Note: The elapsedTime property is not supported in IE9 and earlier versions.