x.lastChild.nodeValue
- by Zeb-ur-Rehman
<html>
<head>
<script type="text/javascript" src="jQuery.js">
<script type="text/javascript">
x=document.getElementByTagName("p");
document.write(x.lastChild.nodeValue);
</script>
</head>
<body>
<p id="intro">Hello World 1!</p>
<p id="intro">Hello World 2!</p>
<p id="intro">Hello World 3!</p>
</body>
</html>
Why doesn't the above code work. I want to show [Hello World 3!] by using the statement documetn.write(x.lastChild.nodeValue());
Thanks in advance...