<html>
<head>
<script type="text/javascript">
function copyLink(){
var e = document.getElementById("copy");
e.select(); // 選擇對象
document.execCommand("Copy"); // 執行瀏覽器複製命令
alert("複製鏈接成功!");
}
</script>
</head>
<body>
<textarea id="copy">複製鏈接成功</textarea>
<input type="button" onclick="copyLink();" value="點擊複製"></input>
</body>
</html>