asp.net.ph

Skip Navigation Links

LOOP Attribute | loop Property

Language References


Specifies whether a media resource will start over again, upon reaching the end.

Syntax


Inline <element loop... >
Script object.loop = true | false ]

Possible Values


true | false ( implied )

The property is read/write with a default value of false.

Remarks

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

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:

Applies To

AUDIO   VIDEO

See Also



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note