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

parent traversal using remove, no luck with question been a day now

const removeMe = document.querySelector('.remove_me'); let parent; $(".parent").parent().removeClass(".remove me");

2 Answers

Hi Thomas, I'm not sure what you're attempting to do based solely on your post, but I noticed something in your syntax that may help.

You posted...

const removeMe = document.querySelector('.remove_me'); let parent; $(".parent").parent().removeClass(".remove me"); not working for me, please help"

I'm assuming you're setting your variables here. Look at the "let parent" variable, and the last (".remove me"). You have a semi colon instead of an equal sign after the "let parent" and you have a space in between .remove and me in your last removeClass method.

Try this instead.

const removeMe = document.querySelector('.remove_me');
let parent = $('.parent).parent().removeClass(".remove_me");

I hope this helps, at least a little bit. If you could explain more of what you're attempting to achieve, I might be able to help a bit more.

Cheers!

const removeMe = document.querySelector('.remove_me'); let parent; $(".parent").parent().removeClass(".remove me"); not working for me, please help