Style animationIterationCount property

Definition and usage

animationIterationCount Property sets or returns the number of times the animation should play.

Example

Change the animationIterationCount property of the <div> element:

document.getElementById("myDIV").style.animationIterationCount = "infinite";

Try it yourself

Syntax

Return the animationIterationCount property:

object.style.animationIterationCount

Set the animationIterationCount property:

object.style.animationIterationCount = "number|infinite|initial|inherit"

Property value

Value Description
number The number defining how many times the animation should play. The default value is 1.
infinite Specifies that the animation should play indefinitely (forever).
initial Sets this property to its default value. See initial.
inherit This property inherits from its parent element. See inherit.

Technical details

Default value: 1
Return value: string, indicating the element's animation-iteration-count Property.
CSS version: CSS3

browser support

animationIterationCount is a CSS3 (1999) feature.

All browsers fully support it:

Chrome Edge Firefox Safari Opera Internet Explorer
Chrome Edge Firefox Safari Opera Internet Explorer
supported supported supported supported supported 11

related page

CSS Reference Manual:animation-iteration-count Property