<html>
<body>
<h3>A demonstration of how to access a SOURCE element</h3>
<audio controls>
<source id="mySource" src="horse.mp3" type="audio/mpeg">
<source src="horse.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>
<p>Click the button to get the URL of the media file.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("mySource").src;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_source_get by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:22:13 GMT -->
</html>