URL 복사

aepee·2021년 7월 11일
0
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이 복사되었습니다.");
}
profile
📝내가 보려고 기록하는 블로그

0개의 댓글