The dragLeave event fires before drop for HTML5 drag and drop events

To solve this issue for drag and drop event, dragLeave fires before drop sometimes:

onDragOver = function(e) { e.stopPropagation() }
onDrop = function(e) {
   /* for drop */

Under drop, you can set this:

function drop(ev)
   var data=event.dataTransfer.getData("Text");;

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 28-Jan-2020


Kickstart Your Career

Get certified by completing the course

Get Started