copy to clipboard?

This commit is contained in:
Zynh0722 2023-04-13 13:51:14 -07:00
parent 4d12dfd7e0
commit 3fb93e3598

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>