Radified Community Forums
http://radified.com/cgi-bin/yabb2/YaBB.pl
Rad Community Technical Discussion Boards (Computer Hardware + PC Software) >> PC Hardware + Software (except Cloning programs) >> DOM and parentNode
http://radified.com/cgi-bin/yabb2/YaBB.pl?num=1243653059

Message started by Rad on May 29th, 2009 at 10:10pm

Title: DOM and parentNode
Post by Rad on 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?

Radified Community Forums » Powered by YaBB 2.4!
YaBB © 2000-2009. All Rights Reserved.