var input = document.getElementById("copyText");input.select(); // 选中文本document.execCommand("copy"); //浏览器复制命令