k

[복사하기] 버튼 자료~

· 13년 전 · 945

<script>
 function copyClip(clip) {
    copyOption = document.body.createTextRange();
    copyOption.moveToElementText(clip)
    copyOption.execCommand('copy');
    alert('복사되었습니다.');
 }
 </script>
 

<button style="cursor:pointer" onclick=copyClip(clip1)>1번복사물</button>
 <div id=clip1 style="display:none">대한민국</div>
 <button style="cursor:pointer" onclick=copyClip(clip2)>2번복사물</button>
 <div id=clip2 style="display:none">축구</div>
 <button style="cursor:pointer" onclick=copyClip(clip3)>3번복사물</button>
 <div id=clip3 style="display:none">국가대표</div>
 <button style="cursor:pointer" onclick=copyClip(clip4)>4번복사물</button>
 <div id=clip4 style="display:none">감독</div>
 <button style="cursor:pointer" onclick=copyClip(clip5)>5번복사물</button>
 <div id=clip5 style="display:none">조광래</div>

|
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
13년 전 조회 5,097
13년 전 조회 1,626
13년 전 조회 1,199
13년 전 조회 1,133
13년 전 조회 3,102
13년 전 조회 807
13년 전 조회 1,510
13년 전 조회 5,806
13년 전 조회 2,605
13년 전 조회 3,510
13년 전 조회 2,302
13년 전 조회 8,240
13년 전 조회 946
13년 전 조회 1.7만
13년 전 조회 6,194
13년 전 조회 687
13년 전 조회 3,644
13년 전 조회 2,102
13년 전 조회 4,336
13년 전 조회 3,049
13년 전 조회 4,242
13년 전 조회 2,059
13년 전 조회 4,630
13년 전 조회 2,068
13년 전 조회 4,992