jquery click on link?

After an event is triggered, how do I make jQuery click on a link with an id of mylink?

Answers:

Answer
$('#lol').click(function() {
   $('#mylink').trigger('click')
   return false;
});

replace click with your event.

Answer

Calling click() without any parameters triggers the event, instead of registering an event handler for it.

$('#mylink').click();
Answer

You probably want something like

window.location = $("#mylink").attr("href");

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us Javascript

©2020 All rights reserved.