When an ‘a’ link is appended into an HTML element it seems to become unresponsive.
http://jsfiddle.net/establish/Aqfrf/
HTML
<div class='tag-holder'>
<span class='tag'><a href='#' class='tag-value'>Design</a></span>
</div>
<div class='tag-tray'>
</div>
jQuery
$(".tag-value").click(function() {
$(this).parent().fadeOut("slow", function() {
$(this).append('<a href="#" class="tag-delete">x</a>').appendTo(".tag-tray").fadeIn("slow");
})
});
$(".tag-delete").click(function() {
alert("This will be displayed only once.");
});
DEMO
the reason is you are appending the element dynamically to the DOM in that you have to use
delegateorliveDEMO with delegate
jquery live
jquery delegate