Easy Tutorial
❮ Prop Win Closed Jsref Continue ❯

Audio src Attribute

Audio Object

Example

Get the URL of the audio file:


Definition and Usage

The src attribute sets or returns the current source of the audio.

The src attribute specifies the location (URL) of the audio file.


Browser Support

All major browsers support the src attribute. However, not all major browsers support the defined audio file formats.

Note: Internet Explorer 8 and earlier versions do not support the <audio> element.


Syntax

Return the src attribute:

Set the src attribute:

Attribute Values

Value Description
URL Specifies the URL of the audio source. Possible values: Absolute URL - points to another website (e.g., src="http://example.com/movie.ogg")<br>Relative URL - points to a file within the website (e.g., src="/data/movie.ogg")

Technical Details

| Return Value: | String, representing the URL of the audio file. Returns the actual URL, including the protocol part (e.g., http://) | | --- | --- |


Related Pages

HTML Reference: HTML <audio> src Attribute


❮ Prop Win Closed Jsref Continue ❯