双击复制本页地址的Script代码

<script>
function copyCode(o){o.select();var js=o.createTextRange();js.execCommand("Copy");alert("地址复制成功");}
document.write("<table align=center class=tableborder1 cellpadding=1 cellspacing=0><tr>");
document.write("<td width=10% nowrap class=tablebody1>双击复制本站面地址:</td>");
document.write("<td class=tablebody1><textarea onfocus=this.select() style='width:90%;overflow-y:visible;' ondblclick=copyCode(this) rows=1>");
document.write(self.location+"</textarea></td></tr></table>");
</script>

你可能感兴趣的:(script)