Just a learner
Just a learner

Reputation: 28572

Can I use javascript code to mimic a user click a link and the page goes to the linked page?

Can I use javascript code to mimic a user click a link and the page goes to the linked page? If so, how to do it?

Thanks

Upvotes: 0

Views: 107

Answers (1)

evan
evan

Reputation: 4297

Call the .click() method on the link.

document.getElementById('the-id-of-the-element').click();

Upvotes: 1

Related Questions