for (let button of document.querySelectorAll(".copy-code")) { button.addEventListener("click", async () => { await navigator.clipboard.writeText(button.value) button.textContent = "Copied!" setTimeout(() => {button.textContent = "Copy"}, 1000.0) }) }