X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

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://www.w3schools.com/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

Internet Explorer Firefox Opera Google Chrome Safari

The currentSrc property is supported in all major browsers.

Note: This property is not supported in Internet Explorer 8 and earlier versions.


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

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook