The dragenter
event is fired when a dragged element or text selection enters a valid drop target.
The target object is the immediate user selection (the element directly indicated by the user as the drop target), or the <body>
element.
Bubbles | Yes |
---|---|
Cancelable | Yes |
Default action | Reject immediate user selection as potential target element. |
Interface | DragEvent |
Event handler property | ondragenter |
Examples
See the drag event for example code or this JSFiddle demo.
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'dragenter' in that specification. |
Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
dragenter event | Chrome Full support 4 | Edge Full support 12 | Firefox
Full support
3.5
| IE Full support 10 | Opera Full support 12 | Safari Full support 3.1 | WebView Android No support No | Chrome Android No support No | Firefox Android No support No | Opera Android No support No | Safari iOS Full support 11 | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
- See implementation notes.
- See implementation notes.