Share on Google+Share on Google+

HTML5 source element, Implementation of <source> tag.

In this section, you will see the implementation of <source> tag of HTML5.

HTML5 source element, Implementation of <source> tag.


Here, we will see the implementation and use of <source> tag in HTML5. It is used for embedding media resource in media element. It is not available in HTML 4.01. It is nothing itself. So media tag(audio or video) is important for <source> tag.

Attribute of audio tag:


Declaration Syntax :

Declaration syntax of source tag in HTML5.

<media element>
                    <source src="URL" >  
                          <source src="URL">  
          </media element>

Example of <source> in HTML5:

<!doctype html >
<html >
<title>Source Tag </title>
<p><b>Example of source tag in HTML5.</b></p>
<audio controls="controls" >
<source src="a1.mp3">
<source src="a2.mp3">
Browser does not support audio tag.

Download this code

Difference Between HTML5 and HTML4.01:

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


Posted on: September 15, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.