如何播放 HTML
要逐个播放 HTML <audio> 块,请首先使用以下 HTML −
<audio id = "one"> <source src = "new1.mp3" type = "audio/mp3"> </audio > <audio id = "two"> <source src = "new2.mp3" type = "audio/mp3"> </audio >
以下是你需要做的事情,才能逐个播放音频 −
var one = document.getElementById('one'); one.onended = function() { document.getElementById('two').play(); } one.play();
广告