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

Struggling with the DOM

Hey guys

I'm struggling to get my head around the DOM. I've followed the relevant Treehouse courses and am in the process of reading Dave McFarland's book on JS and jQuery ("the missing manual"). All of this is useful, but for me everything is a little theoretical, and I'm finding it really hard and struggling to remember everything needed. Can anyone point me in the direction of a useful set of practice exercises or a book / resource that contains lots of practical examples?

(If any mods are reading, I found the Treehouse content to skip over it a bit, and think the DOM in JS would benefit from an in-depth workshop or course of its own. Specifically, a set of practice exercises for all the different functions would be awesome).

Thanks!

Mike

2 Answers

The DOM in the simplest words is the structure of the document.

Think of a tree. The tree has its trunk, then it roots off into the ground right? In our case the trunk is the Document (because that's what holds everything in the HTML) And the roots of the tree are the nodes, elements, tags, comments h1 titles and so on so forth.

The DOM is just the name of the tree!

Hey Lucas

Thanks for replying, appreciate the effort.

I don't think I explained what I wanted very well. Just to be clear, I understand what the DOM is.

I've followed the "Interactive web pages with JS" course on Treehouse as well as a bunch of things elsewhere. All the material I'm working through (Treehouse and elsewhere) offers one quite narrow application of manipulating the DOM to achieve something. What I want to know is is there a structured resource out there to get a ton of practice using DOM keywords such as GetElementByID etc? I've tried playing in the console on a few webpages and found the process a little overwhelming.

What I'm envisaging is something like the playgrounds on the Databases course by Andrew Chalkley - that was a fantastic way of learning to manipulate databases in a safe environment.

Does that make sense?

Thanks again!

Konstantin Kovar
Konstantin Kovar
16,003 Points

Well, to get the whole picture on the JS HTML DOM you can take a look at the full documentation, but I think in terms of real life applications you are well within what you would use a Framework for. So I guess your next steps would be Angular 2 and/or React.