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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![abdul faiz mohd jayramie eng](https://secure.gravatar.com/avatar/a777e1d249c63ecf2b0ea002fd0b49e8?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
abdul faiz mohd jayramie eng
Courses Plus Student 4,478 PointsExtremely noob question on Jquery Challange, help needed
hey im new around here, regestered yesterday.
Im currently doiung "Code Challenge: Using jQuery to Select Elements" i understand partial of CSS advance slectors, unfortunately i couldn't answer this final question, where it says:
"On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?"
shoudn't it be $(".nav ul li"); OR without the (dot) $("nav ul li");
i dont get it, what was my mistake?
5 Answers
![Randy Hoyt](https://secure.gravatar.com/avatar/cd492b1bafd247ec1d52defb632cbd22?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Randy Hoyt
Treehouse Guest TeacherIt does need the dot because "nav" is a class. The selector as you have written it -- $(".nav ul li") -- would find an li in the following structure:
<div class="nav">
<ul>
<li>I'm a list item!</li>
</ul>
</div>
The question is actually asking you to find an li in this structure:
<ul class="nav">
<li>I'm a list item!</li>
</ul>
Does that help?
![James Barnett](https://secure.gravatar.com/avatar/43ea08b4fc547e8a5da87c207bea2123?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
James Barnett
39,199 Points@abdul Have you been through the CSS Foundations
course on Treehouse yet? All of the selectors used in JQuery are the same as the ones from CSS.
The CSS Selectors badge is a great place to start.
![rayorke](https://uploads.teamtreehouse.com/production/profile-photos/21660/micro_rhys_icon.jpg)
rayorke
27,709 PointsWithout a spoiler:
Think of it this way - what element is the class assigned to?
" On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'? "
*Whoops, Randy beat me to it.
![abdul faiz mohd jayramie eng](https://secure.gravatar.com/avatar/a777e1d249c63ecf2b0ea002fd0b49e8?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
abdul faiz mohd jayramie eng
Courses Plus Student 4,478 Pointsthanks guys for the advice! Randy got it right, finally got through it. many thanks!
![Andrew Chalkley](https://uploads.teamtreehouse.com/production/profile-photos/26170/micro_TeacherShoot-Andrew.jpg)
Andrew Chalkley
Treehouse Guest TeacherThanks for helping Abdul all!
Best of luck with the rest of your learning.