0

I am loading (appending) some html content to a page via jQuery, like below.

var html = "<li id='"+id+"' class='sortable-item col3 left'>"+content+"</li>";
var parent = "some element name";                   
$('#'+parent).append(html);

When I try to attach an event (click) to above li element, it is not working. say li id is "event".

$('#event').click(function(){
    alert('clicked');
});

Above code is not working. Can someone give me a solution or a workaround for this problem?

amsandun
  • 3
  • 1
  • 4

0 Answers0