Answer the question
In order to leave comments, you need to log in
How to add button in js?
There is this code:
$('#audio_list').append('<div class="sound_data"><a href="'+value.url+'"><img src="./dw_icon.png"></a> '+value.artist+' - '+value.title+'</div>')
How can I insert a button into it to perform such a function?soundManager.play(''+value.duration+'',{volume:50,onfinish:playNextSound});
Answer the question
In order to leave comments, you need to log in
var button = $("<button>").click(function(){
soundManager.play(value.duration, {
volume : 50,
onfinish : playNextSound
});
});
$('#audio_list').append(button);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question