+ 2

how drag and drop functions work and implemented

function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } function drop(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); ev.target.appendChild(document.getElementById(data)); } </script> </head> <body>

4th Apr 2018, 5:03 PM
Smriti Rastogi
Smriti Rastogi - avatar
1 Réponse
6th Apr 2018, 3:03 AM
Prateek Narang
Prateek Narang - avatar