const button = document.querySelector('button') button.onclick = () => { navigator.clipboard.writeText(window.location.href); }