Events occur on the draggable target
Three events are used to drag an element from the source location.
Event | Functionality |
---|---|
ondragstart | This event is used when the user starts to drag an element. |
ondrag | The ondrag event is used to drag an element. |
ondragend | This event is used to finish the dragging of an element. |
HTML ondrop Event Attribute
The ondrop event attribute is used to drag an element or text and drop it into a valid droppable location or target. The drag and drop is a common feature of HTML 5.
There are different events that are used and occur before ondrop event.
- Events occur on the draggable target
- Events occur on the drop target:
Note: By default, the images and links are draggable.