k

[복사하기] 버튼 자료~

· 13년 전 · 959

<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,110
13년 전 조회 1,636
13년 전 조회 1,204
13년 전 조회 1,142
13년 전 조회 3,112
13년 전 조회 815
13년 전 조회 1,515
13년 전 조회 5,819
13년 전 조회 2,616
13년 전 조회 3,518
13년 전 조회 2,313
13년 전 조회 8,247
13년 전 조회 960
13년 전 조회 1.7만
13년 전 조회 6,206
13년 전 조회 698
13년 전 조회 3,654
13년 전 조회 2,111
13년 전 조회 4,346
13년 전 조회 3,060
13년 전 조회 4,251
13년 전 조회 2,066
13년 전 조회 4,639
13년 전 조회 2,078
13년 전 조회 5,000