I created two elements dinamically with jQuery:
a picture and a Close button
I wrote the code to remove both in doument.ready function:
$( ".deletepreview" ).click(function() {
code = $(this).data("prevcode");
$('#'+code).remove();
$(this).remove();
});
But it doesn't work, and I think this is because the code doesn't search in the code created after the document load.
How can I solve this problem?