Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Page Index Toggle Pages: 1
Send Topic Print
DOM and parentNode (Read 1918 times)
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
DOM and parentNode
May 29th, 2009 at 10:10pm
 
Any DOM studs out there?

Was reading here:

http://www.w3schools.com/htmldom/dom_nodes_access.asp

.. under heading labeled "Navigating Node Relationships" (~ half-way down),

using the following markup:

Code:
<html>
<body>

<p>Hello World!</p>
<div>
  <p>The DOM is very useful!</p>
  <p>This example demonstrates node relationships.</p>
</div>

</body>
</html>

.. where it says:

Quote:
In the HTML code above, the first p element is the first child node (firstChild) of the body element, and the div element is the last child node (lastChild) of the body element.

Furthermore, the <body> is the parent (parentNode) of the every p element.


uh, wouldn't the div element (not the body element) be the parentNode of the two p elements contained within it? (the last 2 paragraphs) Or am I missing something?
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print