English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The loop attribute is a boolean attribute. If present, it specifies that the audio will restart and play in a loop each time it ends.
A song that will automatically replay at the end:
<!DOCTYPE html> <html> <title>HTML:<audio> loop attribute - 基础教程网 oldtoolbag.com</title> <body> <audio controls loop> <source src="horse.ogg" type="audio"/ogg"> <source src="horse.mp3"type="audio"/mpeg"> Your browser does not support the audio element. </audio> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari browsers support the loop attribute.
Note: Internet Explorer 8 and earlier IE browsers do not support the <audio> tag.
The loop attribute is a boolean attribute.
If this attribute is set, the audio will play in a loop.
The <audio> tag is an HTML 5 new tags.
In XHTML, this attribute is not allowed to be abbreviated, the loop attribute must be defined as <audio loop="loop">.
<audio loop>