In this section we shall learn about the Drag and Drop features in HTML5. Drag and Drop features have been introducted in HTML 5, earlier version of HTML didn't had this feature out of the box.
In order to enable drag and drop HTML element, they must have
draggable attribute set to true, like following.
<img id="img1" src="../images/bittergourd.jpg" draggable="true" alt="" ondragstart="DragMe(this, event)" />
draggable attribute, they should also have
In order to make the element droppable where we can drop the element being dragged, we need to set it's following event
See how above events are set.
<div id="div1" style="border:4px dashed #c0c0c0;height:200px;width:400px;padding:10px;margin:30px;"
Let's see all above attributes and events in action in following posts