<html> <body> <script language="javascript"> function function1(){ var myText = document.createTextNode(); myText.data="Data Property for textNode"; alert(myText.data); } </script> <button onclick="function1();">View Node Value</button> </body> </html>