MDN Web Docs

Syntax

js

cancel()

Parameters

None.

Return value

None (undefined).

Exceptions

This method doesn't directly throw exceptions; however, if the animation's playState is anything but "idle" when cancelled, the current finished promise is rejected with a DOMException named AbortError.

Specifications

Specification
Web Animations
# dom-animation-cancel

Browser compatibility

See also

Help improve MDN

Yes No

Learn how to contribute

This page was last modified on by MDN contributors.

Read the original on developer.mozilla.org ↗