<!DOCTYPE html>
<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>