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 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 ClipboardEvent.clipboardData
and 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.