<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
#div1 {width:350px;height:70px;padding:10px;border:1px solid #aaaaaa;}
td{ width:30px; height:30px}
</style>
<script type="text/javascript">
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>
<table border="1">
<tr>
<td><div id="div00" ondrop="drop(event)" ondragover="allowDrop(event)"><span id="drag1" draggable="true" ondragstart="drag(event)">1</span></div></td>
<td><div id="div01" ondrop="drop(event)" ondragover="allowDrop(event)"></div></td>
<td><div id="div02" ondrop="drop(event)" ondragover="allowDrop(event)"></div></td>
</tr>
<tr>
<td><div id="div10" ondrop="drop(event)" ondragover="allowDrop(event)"></div></td>
<td><div id="div11" ondrop="drop(event)" ondragover="allowDrop(event)"></div></td>
<td><div id="div12" ondrop="drop(event)" ondragover="allowDrop(event)"></div></td>
</tr>
<tr>
<td><div id="div20" ondrop="drop(event)" ondragover="allowDrop(event)"></div></td>
<td><div id="div21" ondrop="drop(event)" ondragover="allowDrop(event)"></div></td>
<td><div id="div22" ondrop="drop(event)" ondragover="allowDrop(event)"></div></td>
</tr>
</table>

<br />
<img id="drag1" src="red_button.jpg" draggable="true" ondragstart="drag(event)" width="30" height="30" />

</body>
</html>

