HTML <audio> loop attribute
Definition and usage
loop
The attribute is a boolean attribute.
If this attribute is set, it specifies that the audio will restart after each end.
Example
Song that restarts after each end:
<audio controls loop> <source src="horse.mp3" type="audio/mpeg"> <source src="horse.ogg" type="audio/ogg"> Your browser does not support the audio tag. </audio>
Syntax
<audio loop>
Browser support
The numbers in the table indicate the first browser version that fully supports this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
4.0 | 9.0 | 3.5 | 4.0 | 11.5 |