How do I programmatically click a link with javascript?

Jason Kolok picture Jason Kolok · May 24, 2009 · Viewed 414.7k times · Source

Is there a way to click on a link on my page using JavaScript?

Answer

arik picture arik · Sep 17, 2010
document.getElementById('yourLinkID').click();