docs.rodeo

MDN Web Docs mirror

DataTransfer

{{APIRef("HTML Drag and Drop API")}} 

The DataTransfer object is used to hold any data transferred between contexts, such as a drag and drop operation, or clipboard read/write. It may hold one or more data items, each of one or more data types.

DataTransfer was primarily designed for the HTML Drag and Drop API, as the {{domxref("DragEvent.dataTransfer")}}  property, and is still specified in the HTML drag-and-drop section, but it is now also used by other APIs, such as {{domxref("ClipboardEvent.clipboardData")}}  and {{domxref("InputEvent.dataTransfer")}} . However, other APIs only use certain parts of its interface, ignoring properties such as dropEffect. Documentation of DataTransfer will primarily discuss its usage in drag-and-drop operations, and you should refer to the other APIs’ documentation for usage of DataTransfer in those contexts.

Constructor

Instance properties

Instance methods

Examples

Every method and property listed in this document has its own reference page and each reference page either directly includes an example of the interface or has a link to an example.

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN