1jQuery(document).ready(function (){
2var audioArray = document.getElementsByClassName('songs');
3var i = 0;
4audioArray[i].play();
5for (i = 0; i < audioArray.length - 1; ++i) {
6 audioArray[i].addEventListener('ended', function(e){
7 var currentSong = e.target;
8 var next = $(currentSong).nextAll('audio');
9 if (next.length) $(next[0]).trigger('play');
10 });
11}
12});
13