k

[복사하기] 버튼 자료~

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

<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,863
웹서버 12-12-30 조회 1.9만
Mobile 12-12-29 조회 4,809
PHP 12-12-28 조회 6,035
PHP 12-12-28 조회 5,437
PHP 12-12-28 조회 2,760
jQuery 12-12-27 조회 3,936
jQuery 12-12-27 조회 3,199
JavaScript 12-12-27 조회 3,687
PHP 12-12-27 조회 2,694
PHP 12-12-27 조회 4,110
jQuery 12-12-27 조회 1만
웹서버 12-12-26 조회 5,273
PHP 12-12-20 조회 5,375
JavaScript 12-12-20 조회 1.7만
JavaScript 12-12-20 조회 2,724
PHP 12-12-18 조회 9,288
jQuery 12-12-18 조회 2,874
OS 12-12-15 조회 6,059
OS 12-12-15 조회 7,373
웹서버 12-12-15 조회 8,000
PHP 12-12-14 조회 4,785
OS 12-12-12 조회 4,630
OS 12-12-12 조회 8,569
jQuery 12-12-12 조회 3,637
jQuery 12-12-12 조회 7,635
jQuery 12-12-12 조회 9,492
PHP 12-12-10 조회 2,438
PHP 12-12-10 조회 2,505
OS 12-12-10 조회 6,142