There is a following code:
var a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
What is property download
, how does it work?
There is a following code:
var a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
What is property download
, how does it work?
download
property used to:
Inform anchor element to download link instead on open it.
While downloading, it will use property value as file name.
In this example from w3schools; open it and click on image, after that remove download property and click it again to see difference.