How to append div tag dynamically in html using javascript/
<p>I am creating one div dynamically and want to add it inside another div.</p>

<pre><code>           (js) var divtag = document.createElement("div");
                divtag.innerHTML = xmlhttp.responseText;//Ajax call working fine
                document.getElementById('con').appendChild(divtag);
</code></pre>

<p>html:</p>

<pre><code>enter code here &lt;div id="con"&gt;&lt;/div&gt;
</code></pre>

<p>The the o/p I am getting from AJAX call is Ok, also i am able to view it in browser, but when I am doing a view source I am unable to see the div and its contents.
It should come as :</p>

<pre><code>enter code here &lt;div id="con"&gt;
              &lt;div&gt;
           Contents added @ runtime
         &lt;/div&gt;
          &lt;/div&gt;
</code></pre>

<p>Can somebody suggest where I am going wrong?</p>
