Horje

Example of Doing the Drop - ondrop

index.html
Example: HTML
<script>
function drop(ev) {
  ev.preventDefault();
  var data = ev.dataTransfer.getData("text");
  ev.target.appendChild(document.getElementById(data));
}
</script>

Output should be:

Example of Doing the Drop - ondrop



Single Articles
Example of Doing the Drop - ondropHTML Drag and Drop API
Code explained: (Doing the Drop - ondrop)HTML Drag and Drop API


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

Type:
Html
Category:
Web Tutorial
Sub Category:
HTML Drag and Drop API
Uploaded by:
Admin