I have a code where i appending to div some html over JQuery like
$("#divId").append("<div class='click' data-id='id'></div>");
and I want to acces by click appended div like this
$(".click").click(function(){
var id = $(this).attr('data-id');
alert(id);
});
but when I click, nothink happens, is there some solution for this? Thanks!