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
Paweł Figiel
3,359 PointsIntroduction to jQuery challenge bug
I have a problem with the "Code Challenge: Using jQuery to Select Elements" in "Introduction to jQuery". I can't pass the second part of the challenge even though I think my code is correct.
The instruction is "On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?". My code, including line from the previous part looks like this:
$('#container');
$('.nav li');
I've tried many other combinations but none of them worked .
Can anyone tell me if it is really a bug or am I doing something wrong?
Thanks..
7 Answers
James Barnett
39,199 PointsHere's a hint
The HTML would look something like this:
<ul class="nav">
<li></li>
</ul>
Remember: In this challenge you need to be as specific as possible.
James Barnett
39,199 PointsMartin - Check out this tutorial on using type & class selectors together.
If you are still having issues, post what code you have so far, in your own thread and we'll try to get you straightened out.
Mod Note: Remember the rule of thumb your issue, your code, your thread
Paweł Figiel
3,359 PointsUsed the proper selector and it worked just fine. Thanks!
Martin Rheaume
4,831 PointsWhat is the proper selector in this situation? I went back through the various selector sections on the various css videos, and couldn't find it. I'm ready to just learn what it is, so I can move on.
Martin Rheaume
4,831 PointsThanks, the tutorial was helpful. I'll keep the mod note in mind next time.
Amanda Swartz
2,098 PointsI need the answer too and I don't know how to start my own thread
davidcasanellas
1,099 PointsHi Amanda, the solution to the problem is the following:
$("#container");
$("ul.nav li");
It means that all li elements within a ul with a class="nav" that James said will be selected.