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

Use jQuery to select all list items...

"On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?" I don't understand why the following code won't work: $('nav ul li');

3 Answers

I had to look back to remind myself of the order for CSS on this. The CSS would be "ul.nav li", to be put into jQuery's rules.

Thank you to both of you! This was frustrating me because it's so basic. It was the 'ul.nav' piece that tripped me up.

That piece of knowledge is what this challenge is designed to test.

Check out quick explanation on combining class and type selectors to better understand what's going on there.

Class of nav. That's ".nav" not "nav"

Note the period in front of the former, compared to the latter.