复制
<script type="text/javascript">
function copy()
{
var content=document.getElementById("content");
content.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
alert("已复制好,可贴粘。");
}
</script>
<textarea cols="20" rows="10" id="content">代码区域</textarea>
<input type="button" onClick="copy()" value="点击复制代码" />