I am trying to simulate a click on a element that I appended in.
Example:
var html = "<a data-fancybox data-src="#item52" id="fancy52" href="javascript:;">show</a>";
$("#places").append(html);
appended to:
<div id="places"></div>
Then to simulate a click I do the following:
$("#fancy52").click ();
But this doesn't work. My only guess is because the content was added dynamically.
How can I simulate a click on this dynamic element?