Reputation: 65087
After an event is triggered, how do I make jQuery click on a link with an id
of mylink
?
Upvotes: 1
Views: 454
Reputation: 60580
Calling click()
without any parameters triggers the event, instead of registering an event handler for it.
$('#mylink').click();
Upvotes: 2
Reputation: 143114
You probably want something like
window.location = $("#mylink").attr("href");
Upvotes: 0
Reputation: 186562
$('#lol').click(function() {
$('#mylink').trigger('click')
return false;
});
replace click
with your event.
Upvotes: 2