HTML5 <audio> Tag
Example
Try it yourself » |
Definition and Usage
The <audio> tag defines sound, such as music or other audio streams.
Differences Between HTML 4.01 and HTML5
The <audio> tag is new in HTML5.
Tips and Notes
Tip: Any text inside the between <audio> and </audio> will be displayed in browsers that does not support the audio element.
Attributes
New : New in HTML5.
Attribute | Value | Description |
---|---|---|
autoplayNew | autoplay | Specifies that the audio should start playing as soon as it is ready |
controlsNew | controls | Specifies that playback controls should be displayed |
loopNew | loop | Specifies that the audio should start over again, when it is finished. |
preloadNew | auto metadata none |
Specifies whether or not the audio should be loaded when the page loads |
srcNew | url | Specifies the URL of the audio to play |
Standard Attributes
The <audio> tag also supports the Standard Attributes in HTML5.
Event Attributes
The <audio> tag also supports the Event Attributes in HTML5.