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.
jquery for li in ul in class nav
$(".nav ul li"); whats the correct answer?
Maximiliane QuelCourses Plus Student 55,489 Points
you want to chose the unordered list with the class of nav = ul.nav and within that restriction the list items:
Eric Martz16,007 Points
When selecting an element with a class name, you have to put it together. So all ul elements with the class nav would be ul.nav.
To get the li elements inside the ul with class nav just add it to the end: ul.nav li.
Thanks Eric and Maximiliane for quick reply!!!