A simple audio list and a small example of playback
<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "Utf-8"> <title></title></Head><Body><Scripttype= "Text/javascript">varCount= +; //How many MP3 filesvarIndex= '18.mp3'; //Initialize the file to playwindow.onload= function(){ varAudio= NewAudio (); Audio.preload= true; Audio.controls= true; Audio.loop= false; AUDIO.SRC=index; Document.body.appendChild (audio); Audio.play (); Audio.addeventlistener ('ended', Playendedhandler,false); functionPlayendedhandler () {varname=parseint (index); Name=name+1 < Ten ? '0'+(Name+1)+'. mp3': (Name+1)+'. mp3'; Console.log (name) name>Count&&Audio.removeeventlistener ('ended', Playendedhandler,false); AUDIO.SRC=name; Audio.play (); } varDiv=Document.createelement ('Div'); varul=Document.createelement ('ul'); for (varI= 1; I<=count; I++) { varname=I<Ten ? '0'+I+'. mp3': I+'. mp3' varLi=Document.createelement ('Li'); vartext=document.createTextNode (name); Li.appendchild (text); Ul.appendchild (LI); Li.addeventlistener ('Click',function(event) {AUDIO.SRC=Event.target.innerHTML; Audio.play (); },false)} div.appendchild (UL); Document.body.appendChild (div);}</Script></Body></HTML>
Html5-audio playlists and AutoPlay