Listen for all event types provided in the spec

Suppose the element being animated is animatedElement.
Then begin='animatedElement.mouseout' can be abbreviated to
begin='mouseout'

We can respond to animations beginning or ending by using
begin='animationElement.beginEvent' or begin='animationElement.endEvent'

Note that the response will be delayed in the main thread is busy and
the event takes time to be delivered.
.replace() could be used here.