Answers for "create link and click javascript"

0

create link and click javascript

const link = document.createElement('a');
link.id = 'someLink'; //give it an ID!
link.href = 'https://example.com'; // Your URL

//Add the link somewhere, an appendChild statement will do.
//Then run this
document.getElementById('someLink').click();
Posted by: Guest on October-26-2020

Code answers related to "create link and click javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language