HTML DOM Audio currentSrc property
Examples
Get the current audio URL address:
var x = document.getElementById("myAudio").currentSrc;
x The output is:
http://www.w3cschool.cc/try/demo_source/horse.ogg
try it"
Definition and Usage
currentSrc familiar returns the current URL of the audio.
If the audio is not set, an empty string is returned.
Note: This property is read-only.
Tip: Use the src attribute set audio files URL address.
Browser Support
All major browsers support currentSrc property.
Note: Internet Explorer 8 and earlier versions of IE does not support this property.
grammar
audioObject .currentSrc
technical details
return value: | String that represents the current URL of the audio. Back entity URL, including the protocol (such as http: //). If no audio, it returns NULL. |
---|
Audio Object