The markup
<div id="parent">
<a id="child">Click here please</a>
</div>
Instead of binding event this way this way
$(".child").on("click", function() {
alert("Child clicked!");
});
Bind the click event to parent so the event will always be trigger even if you replace the .child dom
$("#parent").on("click", ".child", function(e) {
alert("Child clicked");
});