Answers for "how to do auto download when you click on a link"

0

how to do auto download when you click on a link

<a href="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png" download>download file</a>
var a = document.createElement('a');
a.href = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
a.download = 'download';

a.click();
Posted by: Guest on January-21-2020

Code answers related to "how to do auto download when you click on a link"

Browse Popular Code Answers by Language