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 |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 4 | (Yes) | 3.5 (1.9.1) | 10 | 12 | 3.1 |
Feature | Android | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|---|---|
Basic support | No support | No support | No support | (Yes) | No support | No support | 10 | No support | No support |
© 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