first of all one of many possible solutions to your specific problem could look like this:
$('.add').click(function() {
$('.second ul').append($(this).removeClass('add').unbind('click'));
});
there are some major issues with your code. one of them is, that you are referencing this
in your updateList()
function (wich points to window
in that case) but that differs from the this
(pointing to the clicked LI
) you receive in your $('.add a').click()
so if you want to handle the addition in an extra function you have to pass the value of this from your click()
function to the updateList()
.
and lastly as this is your first question to stackoverflow, you might consider using proper tags for your future questions as this question has nothing to do with audio, player or playlist. it is a simple jquery problem.
hope i helped you a little bit, and good luck on implementing your audio player