Style animationIterationCount Property
Examples
Change the animationIterationCount property of the <div> element:
document.getElementById("myDIV").style.animationIterationCount="infinite";
Try it Yourself »
Definition and Usage
The animationIterationCount property sets or returns the number of times an animation should play.
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"
Property Values
| Value | Description |
|---|---|
| number | A number that defines the number of times the animation should play. Default value is 1. |
| infinite | Specifies that the animation plays an infinite number of times (forever). |
| initial | Sets this property to its default value. See alsoinitial。 |
| inherit | Inherits this property from its parent element. See alsoinherit。 |
Technical Details
| Default value: | 1 |
|---|---|
| Return value: | A string representing the element's animation-iteration-count property. |
| CSS Version | CSS3 |
Related Articles
CSS Reference:animation-iteration-count property
Other Extensions
Style Object