JS复制剪切板

复制

var url = document.getElementById('crcflowurl');
url.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令

判断是否是IE浏览器

 if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
         window.open(crcflowurl); //打开新的窗口
}       

猜你喜欢

转载自blog.csdn.net/qq_30065395/article/details/79970389