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!
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

Mark Neill
11,797 PointsStuck on basic Code Challenge
Hi Guys
I'm stuck on the first code challenge on 'Building a Responsive Website'.
Challenge On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?
My wrong answers $("nav ul li"); $("nav li"); $(".nav ul li"); $(".nav li");
error message Bummer! Enter the string of the CSS selector for all li elements in a ul element with the class of 'nav'
Cheers
2 Answers

Jacob Miranda
19,073 PointsI was looking for anyone who was having the same issue instead of posting twice... But I don't understand why that worked over the first thing? Could you or anyone explain why $("ul.nav li"); works over $(".nav ul li"); ?
I just don't want to forget or not understand that ^ and then keep making the mistake in future projects. Thanks in advance!

Rene Escobar
7,135 PointsHey Jacob, I was stuck on the same question. It is all about how the question was worded.
On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?
ul is the element that has a class of nav. Think of it as <ul class="nav>.
Mark Neill
11,797 PointsMark Neill
11,797 PointsGot it:
$("ul.nav li");