Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,534 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,534 Points

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

Robert Manolis
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'?