조회 : 376
Provides access to predefined clipboard formats for use in editing operations.
Members Table
The following table lists the members exposed by the clipboardData object. Click a tab on the left to choose the type of member you want to view.
| Method | Description |
|---|---|
| Removes one or more data formats from the clipboard through dataTransfer or clipboardData object. | |
| Retrieves the data in the specified format from the clipboard through the dataTransfer or clipboardData objects. | |
| Assigns data in a specified format to the dataTransfer or clipboardData object. |
<HTML>
<HEAD>
<SCRIPT>
var bResult;
// Select the text to be cut. Trailing spaces in a text
// selection in cut events cause the Cut shortcut menu item to
// remain disabled.
function fnLoad() {
var r = document.body.createTextRange();
r.findText(oSource.innerText);
r.select();
}
// Enable the Cut shortcut menu item over the DIV. Cut is disabled by default.
// Once Cut is enabled, Internet Explorer automatically copies the data to the
// clipboard and removes the selected text from the document.
function fnBeforeCut() {
event.returnValue = false;
}
//Assign data in text format to the window.clipboardData object.
//Display the result (Boolean) from the setData method in the input box below.
function fnCut(){
event.returnValue = false;
bResult = window.clipboardData.setData("Text",oSource.innerText);
oSource.innerText = "";
tText.innerText += bResult;
}
// Enable the Paste shortcut menu item over the DIV. Paste is disabled by default.
function fnBeforePaste() {
event.returnValue = false;
}
// Cancel the returnValue in onpaste for the text input, which
// has a default behavior.
function fnPaste() {
event.returnValue = false;
oTarget.innerText = window.clipboardData.getData("Text");
}
</SCRIPT>
</HEAD>
<BODY onload="fnLoad()" TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="fixed" BGCOLOR="#FFFFFF"
LINK="#000000" VLINK="#808080" ALINK="#000000">
<DIV CLASS="clsSource" ID="oSource" onbeforecut="fnBeforeCut()" oncut="fnCut()">
Select and cut this text
</DIV>
<DIV CLASS="clsTarget" ID="oTarget" onbeforepaste="fnBeforePaste()" onpaste="fnPaste()">
Paste the Text Here
</DIV><BR>
<SPAN CLASS="clsData">setData Result: </SPAN>
<INPUT CLASS="clsText" ID="tText" TYPE="text" READONLY VALUE="" SIZE="6" TABINDEX="-1">
</BODY>
</HTML>IE전용 DHTML 이라는군요.
| 제목 |
|---|
| [기본형] HTML (with 부트스트랩5.3 , jquery 3.7, vue.js) |
| 유용한 리눅스(LINUX) 명령어 |
| [공지] 기술 게시판 |
일 |
월 |
화 |
수 |
목 |
금 |
토 |
|---|---|---|---|---|---|---|
|
10.26
|
10.27
|
10.28
|
10.29
|
10.30
|
10.31
|
11.1
|
|
11.2
|
11.3
|
11.4
|
11.5
|
11.6
|
11.7
|
11.8
|
|
11.9
|
11.10
|
11.11
|
11.12
|
11.13
|
11.14
|
11.15
|
|
11.16
|
11.17
|
11.18
|
11.19
|
11.20
|
11.21
|
11.22
|
|
11.23
|
11.24
|
11.25
|
11.26
|
11.27
|
11.28
|
11.29
|
|
11.30
|
12.1
|
12.2
|
12.3
|
12.4
|
12.5
|
12.6
|