I am really struggling why I can't get this trigger or click to work?
here is the JS:
$(document).ready(function () {
function libertyPop(){
var popUp = jQuery("#lightbox-30835684809970");
popUp.click();
popUp.trigger('click');
console.log("should work");
}
libertyPop();
});
This should be triggering a click on this anchor:
<a id="lightbox-30835684809970" style="cursor:pointer;color:blue;text-decoration:underline;">
Liberty Pop-Up
</a>
In the page, when I actually click on the link, the pop up will appear, i don't understand why the jquery 'trigger' or 'click' is not doing the same?