HTML <audio> autoplayAttribute
Examples
An audio element set to autoplay:
<audio controls autoplay>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">Your browser does not support the audio element.</audio>
Try it Yourself »
Browser Support
![]()
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the autoplay attribute.
Note:Internet Explorer 8 and earlier versions do not support the <audio> tag.
Definition and Usage
The autoplay attribute specifies that the audio will start playing as soon as it is ready.
If this attribute is set, the audio will play automatically.
Differences between HTML 4.01 and HTML 5
The autoplay attribute is new in HTML 5.
Differences between HTML and XHTML
In XHTML, attribute minimization is not allowed, and the autoplay attribute must be defined as <audio autoplay="autoplay">.
Syntax
<audio autoplay>
Other Extensions
HTML <audio> Tag