function jsCopy(){
var e=document.getElementById("inviteLink");//对象是contents
e.select(); //选择对象
tag=document.execCommand("Copy"); //执行浏览器复制命令
if(tag){
alert('复制内容成功');
}
}
function download() {
var img = document.getElementById("qRCodeImg");
var a = $("<a></a>").attr("href", img.src).attr("download", "my-image.png").appendTo("body");
a[0].click();
a.remove();
var e=document.getElementById("inviteLink");//对象是contents
e.select(); //选择对象
tag=document.execCommand("Copy"); //执行浏览器复制命令
if(tag){
alert('复制内容成功');
}
}
function download() {
var img = document.getElementById("qRCodeImg");
var a = $("<a></a>").attr("href", img.src).attr("download", "my-image.png").appendTo("body");
a[0].click();
a.remove();
}
注:上述复制命令只有部分浏览器支持,且只能复制非隐藏域内容