Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
myJS = {
    myFunction: function()
    {
        //This works
      //document.write("Hello world. ");
        //This does not work
        document.getElementById("p01").appendChild(document.createTextNode("Hello world, again"));
    }
};  
</script>
</head>
<body onload="myJS.myFunction();">
<p id="p01"></p>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers