I'm able to add a link dynamically on my page, but it doesn't seem to be a link recognized by my javascript code :
Javascript code to add the link :
var myLink = $('<a>',{
text: 'My Link',
id : 'link-1',
href: '#'
}).appendTo('#book');
Javascript code to access the link :
$("#link-1").click(function () {
alert('link-1 clicked');
});
But when i click the new link created, there's no alert.
Do you have an idea how i can resolve the issue ?
Thanks in advance for your help