Javascript examples for DOM:Element innerHTML
access child elements within dom
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w ww. j a v a2 s . co m*/ nodes = document.getElementsByTagName('custom'); for (var i = 0; i< nodes.length; ++i) { paragraphs = nodes[i].getElementsByTagName('p'); console.log(paragraphs[0].innerHTML); } } </script> </head> <body> <custom> <p>This is a text</p> </custom> </body> </html>