k

[복사하기] 버튼 자료~

· 2012-12-20 (목) 16:18:44 · 2733

<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>

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

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
MySQL 12-12-30 조회 6,872
웹서버 12-12-30 조회 1.9만
Mobile 12-12-29 조회 4,821
PHP 12-12-28 조회 6,045
PHP 12-12-28 조회 5,448
PHP 12-12-28 조회 2,774
jQuery 12-12-27 조회 3,941
jQuery 12-12-27 조회 3,206
JavaScript 12-12-27 조회 3,697
PHP 12-12-27 조회 2,703
PHP 12-12-27 조회 4,118
jQuery 12-12-27 조회 1만
웹서버 12-12-26 조회 5,281
PHP 12-12-20 조회 5,389
JavaScript 12-12-20 조회 1.7만
JavaScript 12-12-20 조회 2,734
PHP 12-12-18 조회 9,294
jQuery 12-12-18 조회 2,883
OS 12-12-15 조회 6,069
OS 12-12-15 조회 7,383
웹서버 12-12-15 조회 8,010
PHP 12-12-14 조회 4,803
OS 12-12-12 조회 4,645
OS 12-12-12 조회 8,583
jQuery 12-12-12 조회 3,645
jQuery 12-12-12 조회 7,643
jQuery 12-12-12 조회 9,501
PHP 12-12-10 조회 2,447
PHP 12-12-10 조회 2,510
OS 12-12-10 조회 6,151