html内容
js代码
function copyText() {
var Url2 = document.getElementById("keydiv").innerText;
var oInput = document.createElement('input');
oInput.value = Url2;
document.body.appendChild(oInput);
oInput.select();
document.execCommand("Copy");
oInput.className = 'oInput';
oInput.style.display = 'none';
alert('复制成功');
}