Style animationPlayState attribute

Definition and usage

animationPlayState This attribute specifies whether the animation is running or paused.

Note:Use this property to pause animation in the middle of a loop.

See also:

CSS Reference Manual:animation-play-state attribute

Example

Pause animation:

document.getElementById("myDIV").style.animationPlayState = "paused";

Try it yourself

Syntax

Return animationPlayState attribute:

object.style.animationPlayState

Set animationPlayState attribute:

object.style.animationPlayState = "running|paused|initial|inherit"

Attribute value

Value Description
running Default value. Specifies that the animation is running.
paused Specifies animation pause.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical details

Default value: running
Return value: A string that represents the animation-play-state attribute.
CSS version: CSS3

Browser support

animationPlayState is a CSS3 (1999) feature.

All web browsers fully support it:

Chrome Edge Firefox Safari Opera IE
Chrome Edge Firefox Safari Opera IE
Stöd Stöd Stöd Stöd Stöd 11