'createTextNode()' Example : createTextNode « Node Operation « JavaScript DHTML






'createTextNode()' Example

 
    
<html>
<body>
<script language="JavaScript">
function function11() {
   var myNode = document.createTextNode("New Text Node");
   document.body.appendChild(myNode); 
} 
</script>
<button onclick="function11();">Create text node</button>
</body>
</html>

    
      
        
  








Related examples in the same category

1.Get body element, create a paragraph tag and a text node