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

jonathan sumner
jonathan sumner
8,965 Points

is this question broken?

I might be missing something, but, to me, the answer is clearly "const parentOfDiv = div.parentNode;". The problem is that even if I copy and paste the answer from the forum it still fails me, and because there are only 4 questions, getting one wrong fails the quiz.

question: "in the code below, the constant 'div' contains a reference to a DOM element. Select its parent node and store that in the constant 'parentOfDiv'.

am I wrong?

4 Answers

jonathan sumner
jonathan sumner
8,965 Points

I've taken the quiz 5-10 times. turns out, on this particular question, even though it is basically the same as one of the other questions that allows a semi-colon, if you use a semi-colon in the answer it fails you. Semi-colons are common practice and good syntax, I thought. Not in this case, though. This is a little frustrating.

Reggie Williams
STAFF
Reggie Williams
Treehouse Teacher

Hey jonathan sumner I'm sorry this took up a bunch of your time. I'm happy to make the fix if you can link to the quiz you're referring to

jonathan sumner
jonathan sumner
8,965 Points

Hi Reggie Williams , Thanks for the great content. I've been doing 2x speed for the last couple of days, my apologies about my phrasing. the link is here: https://teamtreehouse.com/library/interacting-with-the-dom/traversing-the-dom/traversal-review

Reggie Williams
Reggie Williams
Treehouse Teacher

Thanks for the feedback! No worries sometimes the question doesn't get linked to the content. It looks like this one is broken at the moment so thanks for bringing attention to this.