I am appending an li to a ul, for example:
$(".vocab-list").append( $('<li onclick="play_sound(\''+val['audioURL']+'\');" class="vocab-word" id="vocab_' + val['id']+ '"><img width="230px" height="230px" src="' + val['imageURL'] + '" /><div><i class="fa fa-play-circle"></i>' + val['word'] + '</div></li>').hide().fadeIn(600));
Now I am trying to do something onclick so using the following but its not working
$( ".vocab-word" ).click(function() {
alert( "Handler for .click() called." );
});