HTML loop Attribute

❮ HTML Attributes


<audio controls loop>
	<source src="audio/demo.mp3" type="audio/mpeg">
	<source src="audio/demo.ogg" type="audio/ogg">
	Your browser does not support the audio tag.


This Boolean attribute, if present, indicates that the audio and video should loop.

Standard Syntax

HTML: <element loop>

XHTML: <element loop="loop">

Browser Support


Applies to:

The loop attribute can be used on the following element:

Element Attribute
<audio> loop
<video> loop

Attribute Values

Value Description
loop This is a boolean attribute, the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.

More Examples


<video width="340" height="260" controls loop>
	<source src="demo/video.mp4" type="video/mp4">
	<source src="demo/video.webm" type="video/webm">
	Your browser does not support the video tag.
❮ HTML Attributes