Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML source src attribute

HTML src property

HTML source Tag Reference HTML tag

Example

An audio player with two source files. Which file should the browser choose (if the browser supports both source files):

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the src attribute.

**Note:** Internet Explorer 8 and earlier versions do not support 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 tag is new in HTML5.

Syntax

  • Relative URL - points to a file within the website (such as href="horse.ogg")
  • |

    HTML source Tag Reference HTML tag