The DataTransfer.dropEffect
property controls the feedback (typically visual) the user is given during a drag and drop operation.
The DataTransfer.effectAllowed
property specifies the effect that is allowed for a drag operation.
Readonly
filesThe files
read-only property of DataTransfer
objects is a list of the files in the drag operation.
Readonly
itemsThe read-only items
property of the DataTransfer interface is a A DataTransferItemList object containing DataTransferItem objects representing the items being dragged in a drag operation, one list item for each object being dragged.
Readonly
typesThe DataTransfer.types
read-only property returns the available types that exist in the DataTransfer.items.
The DataTransfer.clearData()
method removes the drag operation's drag data for the given type.
Optional
format: stringThe DataTransfer.getData()
method retrieves drag data (as a string) for the specified type.
The DataTransfer.setData()
method sets the drag operation's drag data to the specified data and type.
When a drag occurs, a translucent image is generated from the drag target (the element the HTMLElement/dragstart_event event is fired at), and follows the mouse pointer during the drag.
The
DataTransfer
object is used to hold any data transferred between contexts, such as a drag and drop operation, or clipboard read/write.MDN Reference