<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>
<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>
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
38 | 스크롤바를 따라다니는 이미지 | 박상현 | 2003.12.04 | 1616 |
37 | 이벤트 종류알기 및 좌표 읽기 | 박상현 | 2003.12.03 | 1935 |
36 | socket으로 구현된 구미호 채팅방 V1.0.1 | 박상현 | 2003.11.24 | 2649 |
35 | 문서크기에 맞게 아이프레임폭 자동으로 조정하기 | 박상현 | 2003.11.17 | 1865 |
34 | 목록에서 선택된 라인에만 색칠하고 다른것은 이전색으로 변경하기 | 박상현 | 2003.11.13 | 1641 |
33 | 목록에서 다중 선택된 항목을 표시(특정색상)하고 체크박스를 선택해주는 스크립트 | 박상현 | 2003.11.07 | 2789 |
32 | 여러가지의 색으로 롤오버 효과및 항목을 선택시 선택된 색을 고정시키는 예제 | 박상현 | 2003.11.07 | 2148 |
31 | 쇼핑몰에 포함될 기능(참고) | 박상현 | 2003.11.06 | 1559 |
30 | 한글처리 방법/절차 이해 | 박상현 | 2003.10.20 | 1873 |
29 | event.keyCode의 숫자표 | 박상현 | 2003.10.20 | 1824 |
28 | jsp페이지에서 popup창의 depth에 따른 메인 복귀 방법 달리하기... | 박상현 | 2003.10.14 | 3411 |
27 | 배포하기(Cab 파일 작성법) | 박상현 | 2003.10.13 | 2531 |
26 | 정수값을 3자리수마다 컴마를 찍기 | 박상현 | 2003.10.13 | 2121 |
25 | Applet 에서 JavaScript 를 호출 | 박상현 | 2003.10.13 | 2356 |
24 | 색상표 | 박상현 | 2003.10.10 | 1731 |
» | [javascript]textarea의 내용을 클립보드에 담아 처리하기 | 박상현 | 2003.10.09 | 3613 |
22 | [제로보드]게시물 소스보기 기능추가 | 운영자 | 2003.10.09 | 3103 |
21 | Visual c++로 ActiveX작성하고 웹페이지에 붙이는 방법설명.. | 운영자 | 2003.10.09 | 2138 |
20 | 간단한 메일보내기 | 운영자 | 2003.10.09 | 1798 |
19 | WEB-FTP | 운영자 | 2003.10.09 | 1967 |