Can anyone help me... How to use drag and drop....? Give me a simple example to make it understand easily..... | SoloLearn: Learn to code for FREE!

+5

Can anyone help me... How to use drag and drop....? Give me a simple example to make it understand easily.....

6/22/2018 4:53:52 PM

Divyanshi Sahu

3 Answers

New Answer

+6

https://code.sololearn.com/WMmsH6dXCj6s/?ref=app https://www.sololearn.com/learn/HTML/2214/

+6

drag and drop is a event based mechanism. To make html5 elements draggable , we use the draggable attribute. when the draggable attribute is set to true value, the browser will automatically tell that the element is draggable. <div draggable="true"> dragstart, drag, dragenter, dragleave, drop, dragend these are examples of events that are fired up during dragging process. i hope these is useful :)

+5

Just set the draggable attribute of whichever element that you want to drag to “true”.