Hi All, I am creating one div dynamically and want to add it inside another div.
(js) var divtag = document.createElement("div");
divtag.innerHTML = xmlhttp.responseText;//Ajax call working fine
document.getElementById('con').appendChild(divtag);
html:
enter code here <div id="con"></div>
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 :
enter code here <div id="con">
<div>
Contents added @ runtime
</div>
</div>
Can somebody suggest where I am going wrong?