메뉴 건너뛰기

tnt_lang

<html>
<head>
<title>textarea의 내용을 클립보드에 담아 처리하기 </title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="javascript">

        // 클립보드에 있는 값
        var cbData = "";

        function view_tag()
        {
                // 값 읽어내기
                cbData = window.clipboardData.getData('Text');
                alert(cbData);
        }

        function select_tag()
        {
                document.theForm.theArea.select();
        }

        function copy_tag()
        {
                document.theForm.theArea.select();
                window.clipboardData.setData('Text', document.theForm.theArea.value);
                var bSuccess = window.clipboardData.setData('Text', document.form_tag.tag.value);
                document.execCommand('Copy');

                if (bSuccess) alert('성공적으로 본문의 내용이 클립보드로 복사되었습니다.');
                else alert('본문의 내용을 클립보드로 복사하는데 실패했습니다.');

                document.execCommand('Copy');
        }
</script>
</head>

<body bgcolor="#FFFFFF">
<div id="Layer1" align="center">
  <form name="theForm">
    <textarea name="theArea" cols="40" rows="20">
            이것이 복사될문자열이다........
                ....

        다음은 영문..
        text to be copied
        
        </textarea>
  </form>
</div>

<div align=center>
        <input type=button value="태그선택" onclick="select_tag()">
        <input type=button value="태그선택복사" onclick="copy_tag()">
        <input type=button value="클립보드보기" onclick="view_tag()">
        <input type=button value="창닫기" onclick="window.close()">
</div>
</body>
</html>
번호 제목 글쓴이 날짜 조회 수
78 안드로이드 로그인 세션유지에 관한 연구 구퍼 2011.02.22 17444
77 "지금 보고 있는 웹페이지 창을 닫으려고 합니다..." 안나타나게 하기 file 구퍼 2010.07.30 11355
76 c#으로 만든 asp.net 게시판 file 박상현 2003.12.15 5612
75 select box의 option값 정렬 함수 박상현 2004.09.23 5404
74 weblogic5.1과 ant를 이용하여 EJB개발(내부 개발용) 박상현 2004.06.22 5264
73 자바스크립트로 한글 , 초성 중성 종성 분리 (음소분리) 박상현 2005.05.19 4444
72 PDFBox 0.6.1 - Java PDF Library 운영자 2003.04.15 4234
71 능동적으로 select box의 option값 설정및 삭제 박상현 2005.10.24 4087
70 popup창 띄우는 4가지 방법 운영자 2003.09.24 3923
69 정보를 다시 보내지 않으면....<익스플로러 MsgBox방지법>- mothod:post 하늘과컴 2007.10.13 3623
68 C# 메신저 AicacaServer1.2(서버용)... file 박상현 2003.12.15 3616
» [javascript]textarea의 내용을 클립보드에 담아 처리하기 박상현 2003.10.09 3613
66 C# 메신저 AicacaClient1.2(클라이언트용) file 박상현 2003.12.15 3553
65 옥션처럼 실시간으로 남은시간 구하기 구퍼 2008.08.11 3505
64 jsp페이지에서 popup창의 depth에 따른 메인 복귀 방법 달리하기... 박상현 2003.10.14 3411
63 프리페어스테이트먼트에 ? 표 자리에 값을 셋팅후 만들어진 SQL 문을 보는 유틸 운영자 2003.09.18 3244
62 RAS암호 시스템의 구현 박상현 2001.10.16 3176
61 select box관련 함수들(입력, 수정, 삭제, 정렬등) 박상현 2004.09.23 3139
60 [제로보드]게시물 소스보기 기능추가 운영자 2003.10.09 3103
59 PHP로 문서의 HTML DOM을 손쉽게 가져오자~ file 구퍼 2008.08.14 3002
위로