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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![vy le oai](https://secure.gravatar.com/avatar/b31ca52c5a190639b12a7101953b65f7?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
vy le oai
4,697 PointsInheritance between main objects in javascript
Could someone please explain the diagram showing the inheritance between EventTarget, Node and Document at https://developer.mozilla.org/en-US/docs/Web/API/Document
I also want to ask one question: As far as I understand, Event.target is something related to only events Node is a primarily data type for the entire DOM. They can include: document node, element node, text node, comment node, atrribute node. Document is one kind of node
Is it correct? And am I missing something? If so, could you please add something to complete it?
The last question, may be related to the first one, is that I saw window object has many properties like onclick, onclose, onchange, oncopy, etc.. and this is the same to other HTML element objects. So is there an inheritance here?
Thank you very much for your help!
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsIt sounds like you have a good handle on it already. As you observed, Document is one kind of node. This is part of what is being shown in the diagram. The rest of what the diagram is showing is that a Node is one kind of EventTarget.
As to your other question, onclick, onclose, onchange, oncopy, etc. are apparently properties common to GlobalEventHanders like Elements, Document, and Window. But GlobalEventHandlers is what they call a "mixin" and not an object type or interface which would be inherited.
![vy le oai](https://secure.gravatar.com/avatar/b31ca52c5a190639b12a7101953b65f7?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
vy le oai
4,697 PointsThank so much! You have made my day :D