FAQ: The Document Object Model - The DOM as a Tree Structure

This community-built FAQ covers the “The DOM as a Tree Structure” exercise from the lesson “The Document Object Model”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

FAQs on the exercise The DOM as a Tree Structure

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

There is an error in the picture.

Either the HTML has an error or the tree has an error, but the grandchild of body with a parent of H1 does not match the HTML.

Thank you

1 Like

If one studies the illustration closely, we see there are rounded corners which would indicate something other than a child element… A text node. Every element has one if it is not a void element. The text node is appended to the parent node more as a pseudo-child, not a grandchild of the parent’s parent.

I think I may have stated my point poorly.

The text inside of the H1 node states, “The heading”, though the text in the HTML says, “The title”. It is simply a typo it seems. One of them could be changed.

It’s not a typo. It’s a description.

I agree with this. It should be changed from “The heading” to “The title”.