Ads Inside Post

Search in This Blog

Drag and Drop in html

Drag and Drop in html

<title>DRAG AND DROP </title>
<style type="text/css">
.box {width:300px
border:3px solid #009966;}
function allowDrop(ev)

function drag(ev)

function drop(ev)
var data=ev.dataTransfer.getData("Text");;

<p>If you are human then Drag the image to the box </p>
<!--<div class="box" ondrop="drop(event)" ondragover="allowDrop(event)"></div>-->

<div class="box" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<img id="drag1"  src="alien.png" draggable="true" ondragstart="drag(event)" width="200" height="200">

<footer> Drag and Drop in html</footer>