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

JavaScript jQuery Basics (2014) Introduction to jQuery jQuery Documentation: What Does it Mean?

Caesar Bell
Caesar Bell
24,829 Points

DOM Tree

Is there a tool that can take your HTML and produce a DOM tree like structure graph ? Pretty to use to check to make sure you traced out your HTML correctly.

5 Answers

Maybe someone else could chime in but I know you could select elements and get a DOM read out using Chrome. Check the link out below.

https://developer.chrome.com/devtools/docs/dom-and-styles

James Welch
James Welch
10,363 Points

Hey Caesar, if you simply just want to see your DOM structure, open your developer tools in your browser on the page you want to check out (I use f12 to open it quickly)

In the console tab, you saw in the video how Andrew typed in 'document' and pressed enter, he didn't however go into this any further, simply just click the drop down to check the structure. You can also double click on elements to open them up further if it isn't displaying enough ^_^

You probably knew this and I just misunderstood the question, but I'll post this for anyone who has a similar issue anyway :-) Take care and happy coding!

I found this similar discussion on stackoverflow and one of the answer provided this solution which is a somewhat limited version of what you are after. (I suppose you could mess with the CSS and make it look better.) It's better looking than what you see in a browser's dev tools, though it's still not a fluid, eye-pleasing graphics generator like you are after.

Caesar Bell
Caesar Bell
24,829 Points

Hey David, I appreciate this URL, but I read that blog already and have an understanding that Chrome Dev allows me to view it from their panel, but I was wondering if there so type of way of viewing it as a DOM tree structure graphical type of style? I normally use Chrome dev tools to edit and debug my websites, but sometimes to get a better grasp of DOM structure I try and draw it out, maybe doing more work then I should.

Hannah Mackaness
Hannah Mackaness
4,437 Points

Did you ever find something that helps you to do this? Sounds like it would be really helpful!

Caesar Bell
Caesar Bell
24,829 Points

Hannah Mackaness No not yet, I am still looking. I hope I can find something like that because down the road I really think it can be helpful.

Hannah Mackaness
Hannah Mackaness
4,437 Points

I will keep an eye out too! Would be super helpful