Monday, December 6, 2021

To create anchor tag in HTML or create at run time

 <a id="download" href="/a.png"> download </a>


or to create anchor tag on runtime

var a = document.createElement("a");

a.download = "a.png";

a.href = "google.com/a.png";

a.click();


No comments:

Post a Comment