Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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();
 
PREVIOUS NEXT
Tagged: #create #link #click #javascript
ADD COMMENT
Topic
Name
2+4 =