HTML5 drag and drop will not drop

JavascriptWeb DevelopmentFront End Scripts

It is because there is no dragover event handler; however, default event handler of dragover event is used. After that, no drop event is triggered.

e.preventdefault is needed for dragover event before drop event.

If you want to allow a drop, then default handler is prevented for canceling the event. This can be done either by returning false from an attribute-defined event listener or by calling events event.prevent default method.

<div ondragover = "return false">
<div ondragover = "event.preventDefault()">

False is returned when the division has dragover as property.

The default is prevented.

raja
Published on 11-Apr-2018 13:36:30
Advertisements