下载二维码,复制链接,复制链接到淘宝

1.下载二维码

<a class="downErweima" download="二维码" href="/Public/Images/Home/code/code.png">

a标签href值为下载图片值,价格download属性即可

2.复制链接

<input type="text" id="url1" value="http://wx.senke.me/"  readonly>

<input type="button" onClick="copyUrl(1)" value="复制链接" />

function copyUrl(i) {
var Url = document.getElementById("url"+i);
Url.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
}

posted @ 2017-12-23 11:08  米牙  阅读(1726)  评论(0编辑  收藏  举报