J
J
jackie chan2015-10-12 17:12:31
JavaScript
jackie chan, 2015-10-12 17:12:31

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

1 answer(s)
V
Vitaly Inchin ☢, 2015-10-12
@onvorobyov

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 question

Ask a Question

731 491 924 answers to any question