"> " />
Easy Tutorial
❮ Att Button Formenctype Ref Charactersets ❯

HTML <audio> autoplay Attribute

HTML <audio> Tag

Example

An audio element set to autoplay:

&lt;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>

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 autoplay.


Differences Between HTML 4.01 and HTML 5

The autoplay attribute is new in HTML 5.


Differences Between HTML and XHTML

In XHTML, the attribute cannot be abbreviated, and the autoplay attribute must be defined as <audio autoplay="autoplay">.


Syntax


HTML <audio> Tag

❮ Att Button Formenctype Ref Charactersets ❯