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 JavaScript and the DOM (Retiring) Traversing the DOM Solution: Using nextElementSibling

Saqib Ishfaq
Saqib Ishfaq
13,912 Points

need some motivation

i have no idea what m i doin :( does it mean i need to go back and retake the whole chapter of node,child ,parent,previous,next sibling :/ as i am still confused a bit abt the whole concept! any advice peeps would help a great deal, i am still beginner i guess after reaching here............ or may be i have to take different approach towards it! do i need to start techdegree or some sort to get a better understanding of it??? thanks in advance

4 Answers

First of all, don't be too hard on yourself. It's absolutely normal to not get it the first time. I suggest you go back and retake the whole chapter again.

Besides this, I also recommend you try and work with devtools(https://developer.chrome.com/devtools) so you can get a feel of how the DOM is constructed. Inspect for instance this site. See how it has been structured. Look at different DOM elements and manipulate them using devtools.

The only way to get better is through practice so build pages and manipulate them with JavaScript. Don't watch the videos passively saying to yourself that you understand this.

I wish you the best of luck in your journey ! Don't give up!

Saqib Ishfaq
Saqib Ishfaq
13,912 Points

Thanks ovi and shayne, i ll try and stay focus but only things is i keep repeating the videos and practise what guil is doin, over and over again but still no use! i guess m trying to remember what is he doing but in doing so, losing the concept behind of it all. because i can try remember what he's doing in this certain situation but what if there's another situation and if i dont have the concept cleared in my head, i don't think i would achieve anything. this is getting me frustrated:/ any other links or different approach to this whole concept of ,parent,child,siblings ,previous,next elementSiblings???... this is where i lose it all.. i really appreciate ur advice

https://developer.mozilla.org/en-US/docs/Web/API/Node/previousSibling https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes https://developer.mozilla.org/en-US/docs/Web/API/ParentNode

See if MDN documentation will help you out. Check out the examples there. If this doesn't clear your confusion try and break your problem into smaller steps and post a new topic for each issue you're having and I'm sure me or someone else will help you out.

It's very tempting at this stage to try to think of all the issues you have at once. I've done that myself and I can understand the frustration you are experiencing.

Try to write down the concepts that you don't understand and why do you think that is the case then come back and post here and be as detailed as possible.

Remember, use this frustration and issues to fuel yourself to get better. But as with all awesome things, you need to build, fail, repeat. The ones that go that extra mile and repeat when they fail stuff, are the ones that will achieve their dreams.

Have a wonderful and productive week!

Shayne Laufenberg
Shayne Laufenberg
4,213 Points

If you are unsure what you are doing its always good to go back in previous lessons to see what you know. I can tell you from experience that its better to learn programming on your own. Yeah it will be hard at first since its like you are like a baby still learning how to walk, but once u start crawling you will soon start walking and then you learn to run and it only gets better from there. I've coded since I was 11 and i'm always getting better and learning new things, you don't ever finish learning but once you got a good grasp and can build your own applications, it feels so good. Just stick it out and be patient its worth the wait.

Saqib Ishfaq
Saqib Ishfaq
13,912 Points

Thanks guys, spent last 2 days reading and searching for related content on youtube, tried to write some notes, which ,to be honest i have not been doing untill now! dont know writing on paper is a good practise but it helped me, just reading through it ,when i come back to study after breaks. i did the whole chapter again and feeling bit better now. not 100% confident about it, but definitely not as confused as i was before and have resumed the course to move forward now!

Tyler Durden
Tyler Durden
2,406 Points

don't give up. Go and redo the chapter and have a editor like ATOM open and try to do each step by yourself, like hiding/showing the list, hovering and making letters go to upperCase, and adding Li elements, removing elements and moving up and down.

Go slow and try to analyze each line of code to fully understand whats happening. I think you will learn the most diving in and typing simple code (just using 1 button, 1 item on the list etc..), do simple things and do it yourself and you will progress.

Tyler Dix
Tyler Dix
14,230 Points

I cross-reference W3Schools. I won't post the link because I don't want to violate any terms of use, nor do I want to give the impression that I'm plugging them, but do a Google search and navigate to the JavaScript section. From there, there's a whole section on JavaScript HTML DOM Manipulation.

I find it more readable than the MDN documentation. For instance, I learned that every single node has exactly one parent, except for the root node (html). But I'm still totally lost. I've learned that staring at code doesn't help much, and I get frustrated when I practice something that's confusing me. I'm taking a lot of breaks, avoiding any needless outbursts of frustration, and assuming that everyone is struggling to a certain degree, either now or when they were first learning.

Hang in there. If this were easy, HR people would actually know what they're talking about when they probe you for what you're capable of.