Horje
Where to Drop - ondragover | HTML Drag and Drop API Code
Where to Drop - ondragover

The ondragover event specifies where the dragged data can be dropped.

By default, data/elements cannot be dropped in other elements. To allow a drop, we must prevent the default handling of the element.

This is done by calling the event.preventDefault() method for the ondragover event:


Example of Drop - ondragover

This is done by calling the event.preventDefault() method for the ondragover event:
index.html
Example: HTML
<script>
 event.preventDefault()
</script>

Output should be:

Example of Drop - ondragover
Reffered: https://www.w3schools.com/html/html5_draganddrop.asp



Read Full::
HTML Drag and Drop API Code
Category:
HTML Code
Sub Category:
HTML Drag and Drop API Code
Uploaded:
1 month ago
Uploaded by:
Admin
Views:
1

Related Articles
What browsers will support HTML Drag and Drop HTML Drag and Drop API Code
How to create HTML Drag and Drop Example HTML Drag and Drop API Code
How to Make an Element Draggable HTML Drag and Drop API Code
What to Drag - ondragstart and setData() HTML Drag and Drop API Code
Where to Drop - ondragover HTML Drag and Drop API Code
How to Do the Drop - ondrop HTML Drag and Drop API Code
How to drag and drop an image from left to right HTML Drag and Drop API Code

Single Articles
Example of Drop - ondragover

Share on: