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 Build an Interactive Website Introduction to jQuery Using jQuery to Select Elements

Having problem with te second task of the code challenge

I don´t know what else to try with the second task of the code challenge, need some help please.

I think the correct answer is this

$(".nav li");

but doesn´t works :/

3 Answers

Alex Heil
Alex Heil
53,547 Points

hi julio, I just re-did the challenge to see where the problem is coming form. Also as Robert Manolis pointed out it's always helpful to post the question so we can help you out ;)

to wrap this up, the question in the challenge was: On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?

now comparing your code with the question:

$(".nav li");

you're almost there - you selected the class nav and then the list items within that class. but the question wants you to be more specific, it asks to select the unordered list with the class of nav. I guess you can already imagine what's missing?

at the end the full code that would pass would look like this:

$("ul.nav li");

hope that helps and have a nice day ;)

Thank you very much Alex, Best Regards!

Alex Heil
Alex Heil
53,547 Points

you're welcome, julio. great to hear this helped you out ;)

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

show what the code challenge is asking for, and maybe I can help :)

Thank you Robert! I´m not still familiar with the forum so i´m a bit slow interacting with it, the answer has been respond thank you again :) Best Regards!

Sorry jeje

The code challenge asks:

On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?