I have an element, an anchor, how can I “click it” with jQuery, I mean like a normal user click, because I’m receiving a click on an element..but also I need to fire more events…
Ok here is my example
<a class="som" href="http://domain.com/ssl-signup.php" target="_blank">Test Link</a>
$(document).ready(function(){
$('.som').click();
});
But nothing happens!
Best Regards.
Firing the
clickaction for an anchor will not redirect the user to the anchor’s URL as you would expect with a normalclick.Instead, you’ll need to do this:
EDIT — CORRECT ANSWER BELOW
I misunderstood the question. To accomplish what you want, just make this call to simulate the
click: