Latest web development tutorials

HTML audio loop properties

HTML audio tag Reference Manual HTML <audio> tag

Examples

Set the audio loop:

<audio controls loop>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
您的浏览器不支持 audio 元素。
</audio>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 9+, Firefox, Opera, Chrome, and Safari browser support loop properties.

Note: Internet Explorer 8 and earlier IE browser does not support the <audio> tag.


Definition and Usage

loop attribute is a Boolean attribute.

If this property is set, the audio will loop.


Differences between HTML 4.01 and HTML5

<Audio> tag is new in HTML 5 tag.


The difference between HTML and XHTML

In XHTML, this property is not allowed shorthand, loop attribute must be defined as <audio loop = "loop">.


grammar

<audio loop>


HTML audio tag Reference Manual HTML <audio> tag