Language References
Specifies whether a media resource will start over again, upon reaching the end.
Inline |
<element loop... > |
Script |
object.loop = true | false ] |
The property is read/write with a default value of false.
The loop attribute is a boolean attribute, meaning its presence on an element represents true, and its absence represents false.
When present, the user agent will automatically restart playback of the media resource as soon as it reaches the end.
Example of using the loop attribute with the <audio
> element.
<audio loop controls>
<source src="happy-day.mp3" type="audio/mpeg">
Sorry, your browser does not support the audio element.
</audio>
which would render on a Web page as follows:
Example of using the loop attribute with the <video
> element.
<video loop controls width=640 height=360>
<source src="praise.mp4" type="video/mp4">
Sorry, your browser does not support the video element.
</video>
which would render on a Web page as follows:
AUDIO VIDEO