The DataTransfer
object is used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API.
This object is available from the dataTransfer
property of all drag events
.
Note: All of the properties in this section are Gecko-specific.
-
DataTransfer.mozCursor
-
Gives the drag cursor's state. This is primarily used to control the cursor during tab drags.
-
DataTransfer.mozSourceNode
Read only
-
The Node
over which the mouse cursor was located when the button was pressed to initiate the drag operation. This value is null
for external drags or if the caller can't access the node.
-
DataTransfer.mozUserCancelled
Read only
-
This property applies only to the dragend
event, and is true
if the user canceled the drag operation by pressing escape. It will be false
in all other cases, including if the drag failed for any other reason, for instance due to a drop over an invalid location.
Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
Note: All of the methods in this section are Gecko-specific.
-
DataTransfer.addElement()
-
Sets the drag source to the given element.
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.