k

[복사하기] 버튼 자료~

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

<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,841
웹서버 12-12-30 조회 1.9만
Mobile 12-12-29 조회 4,784
PHP 12-12-28 조회 6,012
PHP 12-12-28 조회 5,408
PHP 12-12-28 조회 2,732
jQuery 12-12-27 조회 3,918
jQuery 12-12-27 조회 3,179
JavaScript 12-12-27 조회 3,669
PHP 12-12-27 조회 2,682
PHP 12-12-27 조회 4,089
jQuery 12-12-27 조회 1만
웹서버 12-12-26 조회 5,252
PHP 12-12-20 조회 5,342
JavaScript 12-12-20 조회 1.7만
JavaScript 12-12-20 조회 2,705
PHP 12-12-18 조회 9,272
jQuery 12-12-18 조회 2,849
OS 12-12-15 조회 6,034
OS 12-12-15 조회 7,352
웹서버 12-12-15 조회 7,971
PHP 12-12-14 조회 4,764
OS 12-12-12 조회 4,604
OS 12-12-12 조회 8,548
jQuery 12-12-12 조회 3,619
jQuery 12-12-12 조회 7,618
jQuery 12-12-12 조회 9,478
PHP 12-12-10 조회 2,419
PHP 12-12-10 조회 2,486
OS 12-12-10 조회 6,120