Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM loop Property

HTML Audio/Video DOM loop Property

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Set the video to loop:

myVid=document.getElementById("video1");

myVid.loop=true;

Try it »


Definition and Usage

The loop property sets or returns whether the audio/video should start playing again when it ends.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the loop attribute.

**Note:** Internet Explorer 8 and earlier versions do not support this property.


Syntax

Set the loop attribute:

audio|video

.loop=true|false

Return the loop attribute:

audio|video

.loop

Attribute values

Value Description
true Indicates that the audio/video should start playing again when it ends.
false Default. Indicates that the audio/video should not start playing again when it ends.

Technical Details

Return Value: Boolean value, true|false
Default value: false

HTML audio/video Tag Reference HTML Audio/Video DOM Reference