HTML
<audio controls id="controls">
<source src="Song.mp3" type="audio/mpeg">
</audio>
的JavaScript
var FileName = document.getElementById("controls").src
alert(FileName)
我试图让警报器说源名称(Song.mp3)不确定如何做到这一点!
答案 0 :(得分:0)
var FileName = $("source").attr('src');
答案 1 :(得分:0)
做的:
var FileName = document.getElementById("controls").getElementsByTagName("source")[0].src;