<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript">
function genDivs(v)
{
var e = document.body;
var row = document.createElement("div");
row.className = "row";
row.style.width = "70%";
row.style.height = "100%";
row.style.border="8px solid black";
row.style.overflow="scroll";
for(var x = 1; x <= v; x++)
{
var cell = document.createElement("div");
cell.className = "gridsquare";
cell.innerText = "class"+x;
row.appendChild(cell);
cell.style.display="inline";
cell.style.width = "25%";
cell.style.height = "100%";
cell.style.border="3px solid black";
cell.style.backgroundImage="url('abc.jpg')";
}
e.appendChild(row);
document.getElementById("code").appendChild(e);
document.getElementById("done").hidden=0;
}
</script>
</head>
<body>
<div style="position:absolute;height:70%;width:70%;border:4px solid black">
<div style="height:20%;width:70%;border:2px solid #00FFFF">
<input name="button" type="button" onclick="genDivs(30)" value="click me" />
</div>
<div id="code" style="height:50%;width:70%;border:2px solid #FF00CC">
</div>
<div id="done" style="height:30%;width:70%;border:2px solid #660066">
<input name="submit" type="button" hidden="1" id="done" value="done" />
</div>
</div>
</body>
</ht
this code is working fine but i want when click on the button"clickme" then the division of class should come inside the second division