Home Tutorial Html Html5 HTML5  audio tag example, Use of audio tag  in HTML5.

 
 

HTML5  audio tag example, Use of audio tag  in HTML5.
Posted on: September 3, 2010 at 12:00 AM
In this section, you will see the use and implementation of audio tag.

HTML5  audio tag example, Use of audio tag  in HTML5.

Introduction:

In this section, you will see the use and implementation of audio tag in HTML5. The <audio> tag is used to add audio in web page or HTML page. When audio tag is not used, browser asks for plugin or script for playing audio or music. It is a paired tag.

The Content present in audio tag will be displayed only when browser does not support.

Attribute of audio tag:

Attribute is used for providing more information to the browser about the tag. There are following attributes in audio tag:

1-autoplay
2-autobuffer
3-controls
4-loop
5-preload
6-src

Declaration Syntax :

Declaration syntax of audio tag in HTML5.

                            <audio src="URL"></audio>

The declaration of audio is case_ insensitive.

Example of <audio> in HTML5:

Code:
AudioTag.html
<!DOCTYPE html >
<html >
<head>
<title>Audio Tag </title>
</head>
<body>
<p><b>Example of audio tag in HTML5.</b></p>
<audio src="a1.mp3" controls="controls" >
Browser does not support audio tag.
</audio>
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

The audio tag  is only available in HTML5. It is not available in HTML4.01.

Related Tags for HTML5  audio tag example, Use of audio tag  in HTML5.:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.