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 jQuery Basics (2014) Creating a Mobile Drop Down Menu Using parent(), hasClass() and prop()

On line 15 of app.js, I am trying to see if the parent of the link has the class of '.selected' but it isn't working. He

it keeps saying the '." in selected is redundant

1 Answer

Kelly von Borstel
Kelly von Borstel
28,880 Points

Hi, Eukael. When you use the hasClass() method, you don't need to put the dot in front of the class name. So the class name should be inside the quotes and inside the parentheses, but you can leave off the dot in front of it.

Kelly von Borstel
Kelly von Borstel
28,880 Points

For the explanation why you leave the dot off, you can rewatch the part of the video starting around 7:30.