📜  单击链接时如何进行自动下载 - Html 代码示例

📅  最后修改于: 2022-03-11 14:53:23.740000             🧑  作者: Mango

代码示例1
download file
var a = document.createElement('a');
a.href = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
a.download = 'download';

a.click();