<p id="para-01"> <span>First span</span> </p> <script type="text/javascript"> var p01 = document.getElementById('para-01'); alert(p01.firstChild.nodeName) </script>