xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>
<p>按下播放按钮等待音频播放完成</p>
<audio id="myAudio" controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
您的浏览器不支持 audio 元素。
</audio>
<script>
var aud = document.getElementById("myAudio");
aud.onended = function()
{
alert("音频已播放完成");
};
</script>
</body>
</html>