FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

Audio currentSrc Property

Audio Object Reference Audio Object

Example

Get the URL of the current audio:

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

The result of x will be:

http://tutorials/jsref/horse.ogg
Try it Yourself »

Definition and Usage

The currentSrc property returns the URL of the current audio.

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

Note: This property is read-only.

Tip: Use the src property to set the URL of a audio file.


Browser Support

Property
currentSrc Yes Yes Yes Yes Yes

Syntax

audioObject.currentSrc

Technical Details

Return Value: A String, representing the URL of the current audio. Returns the entire URL, including the protocol (like http://). If no audio is set, an empty string is returned

Audio Object Reference Audio Object