k

[복사하기] 버튼 자료~

· 13년 전 · 963

<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,116
13년 전 조회 1,640
13년 전 조회 1,213
13년 전 조회 1,144
13년 전 조회 3,115
13년 전 조회 824
13년 전 조회 1,520
13년 전 조회 5,826
13년 전 조회 2,622
13년 전 조회 3,524
13년 전 조회 2,318
13년 전 조회 8,248
13년 전 조회 964
13년 전 조회 1.7만
13년 전 조회 6,210
13년 전 조회 702
13년 전 조회 3,660
13년 전 조회 2,117
13년 전 조회 4,348
13년 전 조회 3,066
13년 전 조회 4,257
13년 전 조회 2,069
13년 전 조회 4,642
13년 전 조회 2,085
13년 전 조회 5,004