A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-loop-attribute/ below:

HTML loop Attribute - GeeksforGeeks

HTML loop Attribute

Last Updated : 12 Jul, 2025

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  


Example 1: Below Example illustrates the use of loop attribute in <audio> element.  

html
<!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.  

html
<!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:  



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4