Easy Tutorial
❮ Prop Checkbox Checked Jsref Parsefloat ❯

Video loop Attribute

Video Object

Example

Set video to loop playback:

document.getElementById("myVideo").loop = true;

Definition and Usage

The loop attribute sets or returns whether the video should play again at the end.

This attribute reflects the <video> loop attribute.

When present, it describes whether the video should replay after it ends.

Note: The <video> element is new in HTML5.


Browser Support

All major browsers support the loop attribute.

Note: The <video> element is not supported in Internet Explorer 8 and earlier versions.


Syntax

Return the loop attribute:

Set the loop attribute:

Attribute Values

Value Description
true false Describes whether the video should replay after each playback. <br> true - Indicates the video should replay at the end. <br> false - Default. Indicates the video should not replay at the end.

Technical Details

Return Value: Boolean, returns true if the video replays after each playback, otherwise returns false.
Default Value: false
--- ---

More Examples

Example

Check if the video restarts after each playback:

var x = document.getElementById("myVideo").loop;
true

Related Pages

HTML Reference: HTML <video> loop Attribute


❮ Prop Checkbox Checked Jsref Parsefloat ❯