Provides access to predefined clipboard formats for use in editing operations.
Remarks
The clipboardData object is reserved for editing actions performed through the Edit menu, shortcut menu, and shortcut keys. It transfers information using the system clipboard and retains it until data from the next editing operation supplants it. This form of data transfer is particularly suited to multiple pastes of the same data.
This object is available in script as of Microsoft® Internet Explorer 5.
Members
Example
This example uses the setData and getData methods with the clipboardData object to perform a cut-and-paste operation through the shortcut menu.
Sample Code
<SCRIPT> // Selects the text that is to be cut. Trailing spaces in a text // selection in cut events causes the cut shortcut menu item to // remain disabled. function fnLoad() { var r = document.body.createTextRange(); r.findText(oSource.innerText); r.select(); } // Enables the Cut shortcut menu item, which is disabled by default over a DIV function fnBeforeCut() { event.returnValue = false; } // Enables the Paste shortcut menu item, which is also disabled by default over a DIV function fnBeforePaste() { event.returnValue = false; } </SCRIPT> </HEAD> <BODY> <DIV ID="oSource" onbeforecut="fnBeforeCut()" > Cut this Text </DIV> <DIV ID="oTarget" TYPE="text" VALUE="Paste the Text Here" onbeforepaste="fnBeforePaste()"><DIV> </BODY>
Applies To
window
See Also