Horje

How to add HTML <audio> loop Attribute

A song that will start over again, every time it is finished:

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.

Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Syntax

<audio loop>

index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>
<h1>The audio loop attribute</h1>
<p>Click on the play button to play a sound:</p>
<audio controls loop> <source src="https://www.w3schools.com/tags/horse.ogg" type="audio/ogg"> <source src="https://www.w3schools.com/tags/horse.ogg" type="audio/mpeg"> Your browser does not support the audio element.
</audio>
</body>
</html>

Output should be:

How to add HTML <audio> loop Attribute




Type :
html
Category :
Web Tutorial
Sub Category :
HTML Tag
Uploaded by :
Admin