copy to clipboard?
This commit is contained in:
parent
4d12dfd7e0
commit
3fb93e3598
1 changed files with 10 additions and 0 deletions
10
dist/link.html
vendored
10
dist/link.html
vendored
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue