Hi Everyone,

Does anyone know why the elements which were added to the DOM by java script are not available when I try to view source? The element were there but are missing when try to view source.



<html xmlns="http://www.w3.org/1999/xhtml">

<input type="button" id="myButton" onclick=TestFunction() value="Click Me"/>


<script type="text/javascript">
document.body.appendChild(NewDiv("div01", "Hello...."));
function NewDiv(id, text) {

var myDiv = document.createElement("Div");
myDiv.id = id;
myDiv.innerHTML = "<H3>" + text + "</h3>"
return myDiv;


function TestFunction() {

var obj = document.getElementById("div01");

if (obj != null) {