click event not working when cloned?
I have a page like this:
<div class="clone" style="display:none;">
<input type="text" name="test" />
<img src="icon_delete.png" class="delete" />
</div>
<button class="clone_div"></button>
When i press the button, it clones the div with success. But inside that div i also have a 'delete icon', to remove that div again. But for some reason it isn't working. I have this JQuery code:
$(".delete").click(function() {
alert('aaa');
});
But it isn't even responding to it. I don't get to this an alert at all... When i use that code with any element that's already loaded then it works fine. But not with the cloned elements... Anyone any idea what i can do to fix this...??