I am trying to add an image tag dynamically
var img = $('<img id="dynamic" class="removed">'); //Equivalent: $(document.createElement('img'))
img.attr('alt', "remove");
imageForm.append(img)
and where ever I have appended this one I want a click function
so I have written
$('.removed').on('click', function (e) {
console.log("e", e);
e.preventDefault();
});
But the event is not getting triggered. what should I do to fix this?