function copyUrl() { let url = window.location.href; let tmp = document.createElement('input'); document.body.appendChild(tmp); tmp.value = url; tmp.select(); document.execCommand("copy"); document.body.removeChild(tmp); alert("URL이 복사되었습니다."); }