Audio currentSrc eigenschap

Definitie en gebruik

currentSrc Deze eigenschap retourneert de huidige URL van het audio.

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

Opmerking:Deze eigenschap is alleen lezen.

Tip:Gebruik src-eigenschap Stel de URL van het audiobestand in.

Voorbeeld

Ophalen van de huidige URL van het audio:

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