javascript点击复制文本框代码
<html><head><title>点击复制地址的代码</title></head>
<body>
<input type="button" name="Submit" onClick='copyToClipBoard()' value="复制">
<input name="hidden" id="aa" value="http://www.jinyon.net/index.html" />
<script language="javascript">
function copyToClipBoard(){
var clipBoardContent = "";
clipBoardContent += document.getElementById( "aa" ).value;
window.clipboardData.setData("Text", clipBoardContent);
alert("复制成功");
}
</script></body></html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>html-Uncle Liu's Blog www.uncleliu.cn</title>
</head>
<body>
<script>
function oCopy(obj){
obj.select();
js=obj.createTextRange();
js.execCommand("Copy");
alert("复制成功");
}
</script>
<input type="text" value="点击我copy!" onclick="oCopy(this)">
</body>
</html>