js创建a标签下载文件
时间:2019-09-10 13:31:08
收藏:0
阅读:1091
const a = document.createElement(‘a‘); // 创建a标签
a.setAttribute(‘download‘, ‘‘);// download属性
a.setAttribute(‘href‘, ‘‘);// href链接
a.click();// 自执行点击事件
原文地址:https://blog.csdn.net/qq_36242361/article/details/83116320
原文:https://www.cnblogs.com/hjbky/p/11495802.html
评论(0)