HTML ondragover Attribute
HTML ondragover Attribute
The ondragover attribute fires when a draggable element or text selection is being dragged over a valid drop target. Links are draggable by default similar to images. We can apply this attribute/event on all HTML elements.
Event Attributes in drag and drop are:-
- Events fired on the draggable target.
- ondragstart event fired when the user starts to drag an element.
- ondrag event fired when an element is being dragged.
- ondragend event fired when the user has finished dragging the element.
- Events fired on the drop target.
- ondragenter event fired when the dragged element enters the drop target.
- ondragover event fired when the dragged element is over the drop target.
- ondragleave event fired when the dragged element leaves the drop target.
- ondrop event fired when the dragged element is dropped on the drop target.
Used With:-
Elements | Event |
---|---|
All elements in HTML | ondragover |
Syntax:-
Its syntax is:- < element ondragover="your_script" >