Horje
HTML loop Attribute

Definition and Usage

The loop attribute is a boolean attribute.

When present, it specifies that the audio will start over again, every time it is finished.


Applies to

The loop attribute can be used on the following elements:

Elements Attribute
<audio> loop
<video> loop

Browser Support

The loop attribute has the following browser support for each element:


How to add A song that will start over again, every time it is finished

Audio Example.
index.html
Example: HTML
<audio controls loop>
  <source src="https://download.samplelib.com/mp3/sample-3s.mp3" type="audio/ogg">
  <source src="https://download.samplelib.com/mp3/sample-3s.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>

Output should be:

How to add A song that will start over again, every time it is finished

How to add A video that will start over again, every time it is finished

Video Example.
index.html
Example: HTML
<video width="320" height="240" controls loop>
  <source src="https://www.sample-videos.com/video321/mp4/240/big_buck_bunny_240p_30mb.mp4" type="video/mp4">
  <source src="https://www.sample-videos.com/video321/mp4/240/big_buck_bunny_240p_30mb.mp4" type="video/ogg">
  Your browser does not support the video tag.
</video>

Output should be:

How to add A video that will start over again, every time it is finished




html loop attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference