On clicking a link, I want to display a div and append another link in that div. Then I want to use click function on the appended link.
In my code below the click function on the link 'click' does not work. I am unable to figure out the problem. I will appreciate any help.
Please check the JsFiddle to see the problem.
Demo: http://jsfiddle.net/QYL3x/
jQuery:
$('.big-link').click(function(e){
$('#myDiv').append('<a class="link" href="#">Click</a>');
});
$('.link').click(function(e){
alert("clicked");
});
HTML:
<a href="#" class="big-link" data-reveal-id="myDiv">Fade</a>
<div id="myDiv" class="reveal-modal"></div>