<html> <head> <title>The title</title> </head> <body> The body </body> </html>
the text The title and The body are considered nodes too, as represented in the following image (from the same site):
note that The title and The body are represented as children of the actual title respective body nodes. What confuses me is: aren't The title and The body text just values of the nodes
A similar example I have met on http://www.w3schools.com/js/js_htmldom_navigation.asp where in a structure like this:
<html> <head> <title>DOM Tutorial</title> </head> <body> <h1>DOM Lesson one</h1> <p>Hello world!</p> </body> </html>
the values of
<p> elements are described like nodes too:
<h1>has one child: "DOM Lesson one"
<p>has one child: "Hello world!"
Why are text values inside nodes considered different nodes and not just text values of the nodes which contain them?