dynamically creating div with dynamic content
<p>I want to Create div dynamically  with unique id.. base on id we need to get values form the database ..but here can get id but divTag.innerHTML= 
not getting id to execute my sql query 
please help me out
thanks in adnvce</p>

<p>
 
    </p>

<pre><code>.dynamicDiv {
width:200px;
height:100px;
border:solid 1px #c0c0c0;
background-color:#e1e1e1;
font-size:11px;
font-family:verdana;
color:#000;
padding:5px;
}

.dynamicDiv{ float:left;}


&lt;/style&gt;

&lt;script type="text/javascript" language="javascript"&gt;
function createDiv($id)
{

        var id =$id;
        var divTag = document.createElement("div");
        var id =$id;
        divTag.id = "div1";
        divTag.setAttribute("align","center");
        divTag.style.margin = "100px auto";
        divTag.className ="dynamicDiv";
        divTag.innerHTML = "&lt;?php $sql =mysql_query("SELECT * FROM TABLE WHERE ID='$id'");
        $res = mysql_fetch_array($sql);
        print_r($res);  
        ?&gt;";
        document.body.appendChild(divTag);
        }

&lt;/script&gt;
&lt;/head&gt;
&lt;body style="float:left;"&gt;
&lt;div  style="float:left;"&gt;
     &lt;b&gt;Click this button to create div element dynamically&lt;/b&gt;
    &lt;input id="btn1" type="button" value=
"create div" onClick="createDiv('&lt;?php echo rand(); ?&gt;');" /&gt;
</code></pre>

<p>
   </p>
