HTML5 audio loop, Use of loop attribute of audio tag in  HTML5.


 

HTML5 audio loop, Use of loop attribute of audio tag in  HTML5.

Use of loop attribute in audio tag.

Use of loop attribute in audio tag.

HTML5 audio loop, Use of loop attribute of audio tag in  HTML5.

Introduction:

Loop attribute is used for reputation of audio or music. It repeats audio file again, until you do not click any controls. It supports only Boolean value either true or false. If it is available in audio tag, music file will be repeated automatically.

loop attribute:
Attribute Value Description
loop Boolean If it is presented in audio tag. Music will repeat itself again and again.

Declaration Syntax :

Declaration syntax of loop attribute  in HTML5.

                       <audio src="URL" controls loop>Content</audio>

Example of  loop attribute in HTML5:

Code:
AudioLoop.html
<!DOCTYPE html >
<html >
<head>
<title>Title of document</title>
</head>
<body>
<p><b>Audio tag Example.</b></p>
<p><b>Implementation of loop attributes in HTML5.</b></p>
<audio src="a1.mp3" controls loop >
Browser does not support audio tag.
</audio>
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

It is new. It is not present in HTML4.01.

Ads