HTML and CSS Reference
In-Depth Information
2
When the user clicks the element and starts dragging it,
the dragstart event is fired. As the element is dragged
over the target, the target fires several events, AS shown here.
As the dragged element enters the target, the
ondragenter event is fired, allowing you to
provide user feedback or set styles.
The ondragstart
event allows
you to set
parameters on
the drag object.
ondragstart
ondragenter
ondragover
ondragover
ondragover
As the element is dragged over
the target, the ondragover
event is fired repeatedly.
3
Finally, when the user releases the mouse button over the
drop area, the ondrop event is fired, this is your opportunity
to read the data set in the ondragstart event and perform
appropriate actions.
ondrop
The dragged
element remains
in the DOM while
being dragged.
A common task for
the ondrop event
IS to remove the
dragged element
from the DOM and
re - insert it as a
child of the target
element.
Now that you have an overview, let's examine the details.
Search WWH ::




Custom Search