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
- Web Animations API
KeyframeEffectAnimationAnimation.playStateAnimation.finishedreturns the promise this action will reject if the animation'splayStateis not"idle".