Javascript examples for DOM:Element childNodes
Access child node's node value
<html> <head></head> <body> <div id="intro"> <h1>DOM Lesson one</h1> <p>Hello world!</p> </div> <script> try//from www .ja va 2s .c om { console.log(document.getElementById("intro").childNodes); var txt=document.getElementById("intro").childNodes[1].nodeValue; document.write(txt); } catch(err) { console.log(err); } </script> </body> </html>