mirror of
https://seed.radicle.dev/rad:z371PVmDHdjJucejRoRYJcDEvD5pp.git
synced 2026-11-16 00:10:37 +08:00
12 lines
418 B
JavaScript
12 lines
418 B
JavaScript
const copyButton = document.getElementById("install");
|
|
const copyResult = document.getElementById("install-copy");
|
|
const textToCopy = document.getElementById("install-command").innerText;
|
|
|
|
copyButton.addEventListener("click", async function () {
|
|
try {
|
|
await navigator.clipboard.writeText(textToCopy);
|
|
copyResult.innerText = "copied";
|
|
} catch (err) {
|
|
console.error("Failed to copy text: ", err);
|
|
}
|
|
}); |