dataTransfer.setData() (Method)

Sets the data in the transfer object.

Availability:

JScript - 5.0
Internet Explorer - 5.0
Property/method value type:Boolean primitive
JavaScript syntax:IEmyDataTransfer.setData(aType, aString)
Argument list:aTypeThe value TEXT or URL to indicate what kind of data is in aString
aStringA text string to be added to the transfer object

You would use this method to put data into the clipboard. This is done by accessing the clipboardData or dataTransfer objects during an event handler. You can only store textual values into the clipboard with this method. However they may be the raw text data itself or a description of the URL where non-text data can be found.

The method takes two arguments. The first can be set to the value "TEXT" or "URL" to indicate which kind of data is being stored. The second argument is the data to be added to the transfer object.

This method returns a Boolean value indicating success or failure of the setData() call.