HTML 5 <audio> tag
Definition and Usage
The <audio> tag defines sound, such as music or other audio streams.
Differences Between HTML 4.01 and HTML 5
The <audio> tag is new in HTML 5.
Tips and Notes
Tip: You can write text inside the start and end audio tags, to show
older browser that they do not support this tag.
Example
Source
Output
<audio src="horse.wav">
Your browser does not support the audio element.
</audio>
Your browser does not support the audio element.
Attributes
Attribute
Value
Description
autoplay
true | false
If set to true, the audio will start playing as soon as it is
ready.
controls
true | false
If set to true, the user is shown some controls, such as a play
button.
end
numeric value
Defines where in the audio stream the player should stop
playing. By default, it plays to the end.
loopend
numeric value
Defines where in the audio stream the loop should stop,
before jumping to the start of the loop. Default is the end attribute's
value.
loopstart
numeric value
Defines where in the audio stream the loop should start.
Default is the start attribute's value.
playcount
numeric value
Defines how many times the audio should be played.
Default is 1.
src
url
Defines the URL of the audio to play
start
numeric value
Defines where in the audio stream the player should start
playing. By default, it plays from the beginning.
Standard Attributes
class, contenteditable, contextmenu, dir, draggable, id,
irrelevant, lang, ref, registrationmark, tabindex, template, title
For a full description, go to Standard
Attributes in HTML 5 .
Event Attributes
onabort, onbeforeunload, onblur, onchange, onclick,
oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave,
ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress,
onkeyup, onload, onmessage, onmousedown, onmousemove,
onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect,
onsubmit, onunload
For a full description, go to Event Attributes
in HTML 5 .
The Altova MissionKit, recent winner of the Jolt Product Excellence and Productivity Award for Best Development Environment,
is an integrated suite of tools ideal for:
XML development
Web & Web services development
Data mapping & integration
Rendering & publishing XML & database data
XBRL validation, taxonomy editing, transformation & rendering
The MissionKit for XML Developers includes XMLSpy®, MapForce®, and StyleVision® plus 3 additional tools for less than the price of 2.
Try all 6 products free for 30 days!
Download a fully-functional free trial