Style animationIterationCount Property

Example

Changing the animationIterationCount property of a <div> element:

document.getElementById("myDIV").style.animationIterationCount = "infinite";
Try it Yourself »

Description

The animationIterationCount property sets or returns how many times an animation should be played.


Syntax

Return the animationIterationCount property:

object.style.animationIterationCount

Set the animationIterationCount property:

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

Property Values

Value Description
number A number that defines how many times an animation should be played. Default value is 1
infinite Specifies that the animation should be played infinite times (for ever)
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: 1
Return Value: A String, representing the animation-iteration-count property of an element
CSS Version CSS3

Browser Support

animationIterationCount is a CSS3 (1999) feature.

It is fully supported in all browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes 11

Related Pages

CSS reference: animation-iteration-count property


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.