<DOCTYPE html>
<html>
  <body>
  <h1 >Shankar Mishra</h1>
  <p id="intro">HelloWorld</p>
  <script type="text/javascript">
    var txt=document.getElementById("intro1").innerHTML;
    if(txt==null)
    {
      alert("id doesnot exist");
    }
    document.write(txt);
    alert(txt.nodeName);
  </script>
  </body>
</html>
When I am changing the id name to "intro" it is not returning the node name also please help me out thanks.
 
     
     
     
    