Good day! Such is the problem: I want to implement switching songs of the html5 player by changing the src
attribute using jQuery. The names of the songs have the form 1.mp3, 2.mp3 ... n.mp3
Here is the html code:
<audio controls style="width:400px; float: right;"> <source class="mp" src="music/1.mp3" type='audio/ogg; codecs=vorbis'> </audio>
Here is the jQuery code:
$('.next').click(function() //next класс кнопки { $('.mp').attr('src','music/'+i+'.mp3'); //скорее всего ошибка здесь i++; //следующая песня, i - глобальная });
Nubian question to horror, but I do not know)