<div id="div1">my div</div>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready (function () {
$("#div1").on("click", function () {
$("#div1").after("<div id='div2'>div2</div>");
});
$(document).on("click", "#div2", function () {
alert("asd");
});
});
</script>