1
0
Fork 0

copy to clipboard?

pull/1/head
Zynh0722 2023-04-13 13:51:14 -07:00
parent 4d12dfd7e0
commit 3fb93e3598
1 changed files with 10 additions and 0 deletions

10
dist/link.html vendored
View File

@ -23,6 +23,14 @@
link_el.innerHTML = link;
}
});
function clipboard() {
let copyText = document.getElementById("link");
navigator.clipboard.writeText(copyText.href);
alert("Copied: " + copyText.href);
}
</script>
</head>
@ -31,6 +39,8 @@
<a id="link" href=""></a>
</div>
<button class="return-button" onclick="clipboard()">Copy to Clipboard</button>
<a href="/" class="return-button">Return to home</a>
</body>