Create a TextNode : createTextNode : DOM Node JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » DOM Node » createTextNode »

 

Create a TextNode

















<html>
<head>
<title>appendChild() Example</title>
<script type="text/javascript">
   function appendMessage() {
      var oNewP = document.createElement("p");
      var oText = document.createTextNode("www.navioo.com");
      oNewP.appendChild(oText);
      document.body.appendChild(oNewP);
   }
</script>
</head>
<body onload="appendMessage()">
<P>Hello World!</p>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo DOM Node
» createTextNode