Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML

HTML

HTML audio Tag Reference HTML

Example

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 »


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Internet Explorer 9+, Firefox, Opera, Chrome, and Safari browsers support the autoplay property.

Note: Internet Explorer 8 and earlier versions do not support the


Definition and Usage

The autoplay property specifies that the audio starts playing as soon as it is ready.

If this property is set, the audio will play automatically.


Differences between HTML 4.01 and HTML 5

The autoplay property is new in HTML 5.


Differences between HTML and XHTML

In XHTML, shorthand is not allowed for this attribute; the autoplay attribute must be defined as


Syntax