HTML <source> srcAttribute
Example
An audio player with two source files. The browser should choose which file (if both source files are supported by the browser):
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<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 Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the src attribute.
Note:Internet Explorer 8 and earlier versions do not support the <source> tag.
Definition and Usage
The src attribute specifies the URL of the media file to be played.
Differences between HTML 4.01 and HTML5
The <source> tag is new in HTML5.
Syntax
<source src="URL.html">
Attribute Values
| Value | Description |
|---|---|
| URL | Specifies the URL of the media file. Possible values:
|
HTML <source> Tag Other Extensions