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()

Jason Butler
Jason Butler
12,394 Points

Creating a mobile drop down box

I need some help with this jquery code. Here is what it is asking in the last challenge of creating a mobile drop down box.

"I am trying to see if the parent of the link has the class of '.selected' but it isn't working. Help me fix it."

this the code I have written but I get a "There was an error with your code: TypeError: 'undefined' is not a function (evaluating '$option.prob("selected", true)')"

if($anchor.parent().hasClass("selected")) { $option.prob("selected", true); }'

Any help would be appreciated I have been racking my brain and cant figure out what the issue is.

Jason Butler
Jason Butler
12,394 Points

NVM...just figured it out@