Horje

Example of ondragstart and setData()

In this case, the data type is "text" and the value is the id of the draggable element ("drag1").
index.html
Example: HTML
<script>
function drag(ev) {
  ev.dataTransfer.setData("text", ev.target.id);
} 
</script>

Output should be:

Example of ondragstart and setData()




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