I've been doing some work on a jQuery script of mine. What I currently have is an image and when clicked it will append an input type text.
$(document).ready(function() {
$('.addParticipant').click(function() {
$('.addParticipantDiv').append('<p><img src="images/iconminus.jpg" style="width:38px; height:38px;cursor:pointer;position:absolute;margin-top:5px;-moz-border-radius: 4px;border-radius: 4px;" class="removeParticipant"/><input type="text" name="ck_email" class="mailitem" style="width:170px;background:#fff; margin-left:40px"/></p>');
});
$('.removeParticipant').click(function() {
alert('oi');
});
});
However I've noticed that this do not work since I am trying to call a click event on a element that has been created dynamically with append. What would be the solution to this challenge? The alert or .removeParticipant does not work.