YouTip LogoYouTip

Prop Style Animationiterationcount

HTML DOM Style animationIterationCount Property

HTML DOM Style animationIterationCount Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

<source>

HTML DOM Table Object

Style animationIterationCount Property

Style Object Reference Manual Style Object

Example

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 be played.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only Firefox supports the animationIterationCount property.


Syntax

Get 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 an animation should be played. Default value is 1.
infinite Specifies that the animation should be played infinite times (forever).
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

Related Articles

CSS Reference: animation-iteration-count Property


Style Object Reference Manual Style Object

<source>

HTML DOM Table Object

← Prop Style AnimationnameProp Style Animationfillmode β†’