The DragEvent
interface is a DOM event
that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element). Applications are free to interpret a drag and drop interaction in an application-specific way.
This interface inherits properties from MouseEvent
and Event
.
DragEvent.dataTransfer
Read only
Although this interface has a constructor, it is not possible to create a useful DataTransfer object from script, since DataTransfer
objects have a processing and security model that is coordinated by the browser during drag-and-drops.
DragEvent()
drag
dragend
dragenter
dragexit
dragleave
dragover
mouseover
).dragstart
drop
GlobalEventHandlers.ondrag
global event handler
for the drag
event.GlobalEventHandlers.ondragend
global event handler
for the dragend
event.GlobalEventHandlers.ondragenter
global event handler
for the dragenter
event.GlobalEventHandlers.ondragexit
global event handler
for the dragexit
event.GlobalEventHandlers.ondragleave
global event handler
for the dragleave
event.GlobalEventHandlers.ondragover
global event handler
for the dragover
event.GlobalEventHandlers.ondragstart
global event handler
for the dragstart
event.GlobalEventHandlers.ondrop
global event handler
for the drop
event.An Example of each property, constructor, event type and global event handlers is included in their respective reference page.
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'DragEvent' in that specification. | Living Standard | |
HTML 5.1 The definition of 'DragEvent' in that specification. | Recommendation | Initial definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 46 | Yes | 3.5 | 10 | Yes | 3.1 |
DragEvent() constructor |
46 | ? | 3.5 | 10 | 12 | 3.1 |
dataTransfer |
46 | Yes | 3.5 | 10 | Yes | 3.1 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | No | No | Yes | Yes | No | No | ? |
DragEvent() constructor |
No | No | ? | Yes | No | No | ? |
dataTransfer |
No | No | Yes | Yes | No | No | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/DragEvent