<div> <audio autoplay id="player"> </div> <script> var array_1 = new Array( "1.mp3", "2.mp3", "3.mp3" ); var player = document.getElementById("player"); player.setAttribute("src", "1.mp3"); while(player.ended){ var path_current = player.getAttribute("src"); var index_current = array_1.indexOf(path_current); player.setAttribute("src", array_1[index_current + 1]); } </script>
我查了一下资料:
应该也就是这两个属性,但无论换成哪一个,也不起作用。
这里应该怎么写?
千秋此意