我正在尝试使用onEnded
HTML5 中的属性一首一首地播放 3 首歌曲。这是我的第一次尝试,但出现错误。
错误 : Uncaught ReferenceError: src is not defined
nextSong marioKart.html:49
onended marioKart.html:58
下面是我的代码:
<script>
function nextSong(){
var song = document.getElementById("player");
song.attr(src,"countdown.wav");
}
</script>
</head>
<body>
<div style="position:relative">
<audio controls autoplay="true" onEnded="nextSong()" onplay="race()" >
<source id="player" src="startMusic.wav" type="audio/mpeg" />
</audio>
有人可以帮助我实现这一目标吗?