웹팁 분류

링크를 클릭하면 주소가 자동으로 복사되는 소스

작성자 정보

  • GW 작성
  • 작성일

컨텐츠 정보

본문


 

링크를 클릭하면 주소가 자동으로 복사되는 소스


주소 또는 텍스트도 가능합니다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script type="text/javascript">
 
function clip(){
    var url = '';
    var textarea = document.createElement("textarea");
    document.body.appendChild(textarea);
    url = window.document.location.href;
    textarea.value = url;
    textarea.select();
    document.execCommand("copy");
    document.body.removeChild(textarea);
    alert("URL이 복사되었습니다.")
}
 
</script>
cs

 


현재 페이지 url을 복사합니다.


위 textarea url에서 특정 url을 지정할수 있습니다.



1
<span class="button gray medium">
<a href="#" onclick="clip(); return false;">
URL주소복사</a></span>
cs




 



아재감성 아재공간 다온네



추천 업체




아재 음악


관련자료

댓글 0
등록된 댓글이 없습니다.
kkk
웹팁 72 / 3 페이지
RSS
알림 0