HTML | loop Attribute
The HTML loop Attribute is used to restart the audio and video again and again after finishing it. It contains the Boolean value.
Syntax:
<element loop>
Applicable
- <audio>
- <video>
Example 1: Below Example illustrates the use of loop attribute in <audio> element.
<!DOCTYPE html> <html> <head> <title> Audio loop Attribute </title> </head> <body style="text-align: center"> <h1 style="color: green"> GeeksforGeeks </h1> <h2 style="font-family: Impact"> HTML Audio loop Attribute </h2> <br> <audio id="Test_Audio" controls loop> <source src="beep.mp3" type="audio/mpeg"> </audio> </body> </html> |
Output:

Example 2: Below Example illustrates the use of loop attribute in <video> element.
<!DOCTYPE html> <html> <head> <title> HTML video loop Attribute </title> </head> <body> <center> <h1 style="color:green;"> GeeksforGeeks </h1> <h3>HTML video loop Attribute</h3> <video width="400" height="200" controls loop> <source src="Canvas.move_.mp4" type="video/mp4"> <source src="Canvas.move_.ogg" type="video/ogg"> </video> </center> </body> </html> |
Output:

Supported Browsers: The browsers supported by loop Attribute are listed below:
- Google Chrome 4.0/4.0
- Internet Explorer 9.0/9.0
- Firefox 3.5/11.0
- Apple Safari 4.0/4.0
- Opera 10.5/10.5
Recommended Posts:
- HTML | <audio> loop Attribute
- HTML | <video> loop Attribute
- HTML | DOM Video loop Property
- HTML | DOM Audio loop Property
- HTML | <map> name Attribute
- HTML | for Attribute
- HTML | dir Attribute
- HTML | low Attribute
- HTML | <li> value Attribute
- HTML | <img> src Attribute
- HTML | value Attribute
- HTML | <a> rel Attribute
- HTML | <img> alt Attribute
- HTML | min Attribute
- HTML | <a> href Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




