Style animationIterationCount Property
Example
changing
The animationIterationCount property of an element:
document.getElementById("myDIV").style.animationIterationCount="infinite";
Try it »
Definition and Usage
The animationIterationCount property sets or returns the number of times an animation is played.
Browser support





Only Firefox supports the animationIterationCount property.
Syntax
Return the animationIterationCount property:
object
.style.animationIterationCount
Set the animationIterationCount property:
object
.style.animationIterationCount="
number
|infinite|initial|inherit"
Attribute values
| Value | Description |
|---|---|
| number | A number that defines the number of times the animation is played. The default value is 1. |
| infinite | Specifies that the animation is played an infinite number of times (forever). |
| initial | Sets this property to its default value. See initial. |
| inherit | Inherits this property from its parent element. See inherit. |
Technical Details
| Default value: | 1 |
|---|---|
| Return Value: | A string representing the animation-iteration-count property of the element. |
| CSS version | CSS3 |
Related Articles
CSS Reference Manual:animation-iteration-count Property
The Style object