Open In App
Related Articles

How to play audio repeatedly using HTML5 ?

Improve Article
Save Article
Like Article

This article will show you how an audio file can be played repeatedly on a web page. This is done by using the loop attribute of the <audio> tag. It is used to restart the audio again and again after loading the web page. This can be used in situations where the audio has to be looped until it is specifically stopped, like in the case of background music on a web page.


<audio loop>



<!DOCTYPE html>
        How to play an audio repeatedly
        using HTML5?
    <h1 style="color: green;">
        How to play an audio repeatedly
        using HTML5?
    <p><b>Non Looping Audio</b></p>
    <audio controls>
        <source src=
    <p><b>Looping Audio</b></p>
    <!-- Using the loop attribute -->
    <audio controls loop>
        <source src=


Supported Browsers:

  • Google Chrome 4.0
  • Internet Explorer 9.0
  • Firefox 3.5
  • Opera 10.5
  • Safari 4.0

Last Updated : 14 Jul, 2020
Like Article
Save Article
Similar Reads
Related Tutorials