Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial2 Answers
Saichand Pullepu
11,905 PointsNode can have multiple elements like parent, child, Sibling. But Elements refer to single element.
Anestis Aou
6,742 PointsI had the same question earlier in the course. What is a node?
From what I read, any part of HTML document is a node.
There are ELEMENT_NODES. ATTRIBUTE_NODES, TEXT_NODES, COMMENT_NODES and others that we don't have to worry yet.
The DOM consists of a hierarchy of nodes where each node can have a parent, a list of child nodes and a nextSibling and previousSibling.
check console:
document instanceof Node ->true
document instanceof Element -> false
document.firstChild -> <html >HTML TAGS</html>
document.firstChild instanceof Node -> true
document.firstChild instanceof Element -> true
Kartik Kapoor
3,016 PointsKartik Kapoor
3,016 PointsThanks for the clarification :).