k

[복사하기] 버튼 자료~

· 13년 전 · 940

<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,086
13년 전 조회 1,620
13년 전 조회 1,194
13년 전 조회 1,123
13년 전 조회 3,098
13년 전 조회 796
13년 전 조회 1,502
13년 전 조회 5,799
13년 전 조회 2,600
13년 전 조회 3,499
13년 전 조회 2,291
13년 전 조회 8,234
13년 전 조회 941
13년 전 조회 1.7만
13년 전 조회 6,188
13년 전 조회 679
13년 전 조회 3,635
13년 전 조회 2,095
13년 전 조회 4,329
13년 전 조회 3,041
13년 전 조회 4,234
13년 전 조회 2,053
13년 전 조회 4,619
13년 전 조회 2,055
13년 전 조회 4,979
🐛 버그신고