YouTip LogoYouTip

Prop Audio Currentsrc

# Audio currentSrc Property [![Image 8: Audio Object Reference](#) Audio Object](#) ## Example Get the URL of the current audio: var x = document.getElementById("myAudio").currentSrc; The _x_ output will be: http://www.w3cschool.cc/try/demo_source/horse.ogg [Try it Yourself Β»](#) * * * ## Definition and Usage The currentSrc property returns the URL of the current audio. If no audio is set, it returns an empty string. **Note:** This property is read-only. **Tip:** Use the (#) property to set the URL of the audio file. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The currentSrc property is supported by all major browsers. **Note:** Internet Explorer 8 and earlier versions do not support this property. * * * ## Syntax _audioObject_.currentSrc ## Technical Details | Return Value: | A string representing the URL of the current audio. Returns the full URL, including the protocol (e.g., http://). If no audio is set, it returns an empty string. | | --- | * * Audio Object](#)
← Prop Audio CurrenttimeProp Audio Controls β†’