When I use .click()
on an <a>
tag, the event only works when I click on the element. Otherwise, if the user does a Right Click > Open in new window or Open in new tab, it doesn't trigger the click()
event.
So, my question is...how do I trigger the click()
event when user does right click > open in new tab/window?
Here is the HTML:
<a href="url">Click Me</a>
Here is the Js:
$("a").click(function(){
alert('You clicked me!');
});
See Question&Answers more detail:os