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

On line 2 of app.js, traverse to the parent element of the removeMe element.

HELP I've been stuck on this

6 Answers

Steven Parker
Steven Parker
243,356 Points

Have you tried using the parentNode property?

It's a bit of a guess without a link to the course, but perhaps something like this:

var parent = removeMe.parentNode;

To enable the most complete and accurate analysis, always include a link to the course page you were working with, and show the code you've written so far

Please explain the answer

The answer to this question is below (basically what he said up there, but the variable they wanted was parent, not myParent:

var parent = removeMe.parentNode;

I am going through the course right now, got stuck and searched for the answer and came across this post. Used your answer to complete the challenge. Thanks Steven.

Steven Parker
Steven Parker
243,356 Points

So I got "two birds with one stone" then. :smile: Glad it helped!

I tried the following and it worked:

```var removeMe = document.querySelector('.remove_me'); var parent = removeMe.parentElement;

Correct answer, thanks to everybody for a soon response, it's very important to continue up when you are in

var parent = removeMe.parentNode;

var parent = removeMe.parentNode;