AnimationPlaybackEvent: AnimationPlaybackEvent() constructor

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2020⁩.

The AnimationPlaybackEvent() constructor of the Web Animations API returns a new AnimationPlaybackEvent object instance.

Syntax

js
new AnimationPlaybackEvent(type)
new AnimationPlaybackEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers set it to cancel, finish, or remove.

options Optional

An object that, in addition of the properties defined in Event(), has the following properties:

detail Optional

An event-dependent value associated with the event. Defaults to null.

Return value

A new AnimationPlaybackEvent object.

Specifications

Specification
Web Animations
# dom-animationplaybackevent-animationplaybackevent

Browser compatibility

See also