Audio currentSrc Attribute

Definition and Usage

currentSrc This property returns the current audio URL.

If no audio is set, an empty string is returned.

Note:This property is read-only.

Tip:Please use src attribute Set the URL of the audio file.

Example

Get the current audio URL:

var x = document.getElementById("myAudio").currentSrc;

Try It Yourself

Syntax

audioObject.currentSrc

Technical Details

Return Value:

String value representing the URL of the current audio.

Returns the entire URL, including the protocol (such as http://).

If no audio is set, an empty string is returned.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support