HTML Audio/Video DOMloopProperty

HTML Audio/Video DOM Reference Manual

Example

Set the video to loop:

myVid=document.getElementById("video1");
myVid.loop=true;

Try it Yourself »

Definition and Usage

The loop attribute sets or returns whether the audio/video should replay after 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 attribute.


Syntax

Set the loop attribute:

audio|video.loop=true|false

Return the loop attribute:

audio|video.loop

Property value

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

Technical Details

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


HTML Audio/Video DOM Reference Manualother extensions