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 triali1276
7,626 PointsWhat is the answer to parentOfDiv question?
The question is: 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.
const div = document.querySelector('div');
const parentOfDiv =
and I try to complete the question with div.parentNode; but it says my answer is incorrect. I tried 5x already and making sure punctuation and capitalization are correct.
What is the answer? This is the old community post, I think my answer should've been correct? https://teamtreehouse.com/community/how-to-select-a-parent-node-and-store-it-in-a-constantdiv
i1276
7,626 Pointsthank you so much jb30! it worked
1 Answer
Steven Parker
231,275 PointsI got a correct answer result by entering div.parentNode;
(with the semicolon).
i1276
7,626 Pointsthey must've fixed the answer, it didn't accept with semicolon before :)
jb30
44,807 Pointsjb30
44,807 PointsThe quiz currently accepts
div.parentNode
without the semicolon.