<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script language="javascript" type="text/javascript">
function copycode() {
document.getElementById("logPanel").select();
var n=document.getElementById("logPanel").value;
alert(n);
window.clipboardData.setData('text',n);
}
</Script>
</head>
<body>
<form>
<input type="text" name="logPanel" value="sdfasdfasdfasfdsdf asdf "/>
</form>
<p> <a href="javascript:void(0)" onclick="copycode()";alert('复制成功,请粘贴到你需要的地方')">复制全文</a>
</p>
</body>
</html>
把文本框的内容复制到剪切板
最新推荐文章于 2022-06-12 19:28:08 发布