asp.net.ph

Skip Navigation Links

setData Method

DHTML Methods


Specifies what data format and information to add to the system clipboard through the dataTransfer object.

Syntax

window.dataTransfer.setData ( [ sDataFormat ] 
   [ ,  vHelperData ] ) 
Parameters

sDataFormat Optional. Specifies the data format to add to the system clipboard using the dataTransfer object. This string value can be one of the following:

Text Default. Specifies that the data being transferred is text.
URL Specifies that the data being transferred is a URL.

vHelperData Associates information with the object being dragged. This information can be descriptive text, a source path to an image, or a URL for an anchor. When URL is passed as the sDataFormat parameter, vHelperData must be used to provide the location of the object being transferred.

Return Value

No return value.

Remarks

The setData parameters are not case-sensitive.

Example

The example demonstrates how to use the setData and getData methods to create a shortcut to an image.

Sample Code


Applies To

dataTransfer

See Also

Data Transfer Overview, clearData, dropEffect, effectAllowed, getData



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note