<script type="text/javascript">
function copyUrl2(){var Url2=document.getElementById("biao1").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('复制成功');}
</script>
<div cols="20" id="biao1">12345678</div>
<input type="button" onClick="copyUrl2()" value="点击复制代码" />
更多专业前端知识,请上 【猿2048】www.mk2048.com