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 trialAndrew Fu
1,477 PointsOn the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?
$(".nav ul li");
Not sure what is wrong here?
3 Answers
bothxp
16,510 PointsI believe ...
.nav ul would be:
<div class="nav">
<ul>
<li></li>
</ul>
</div>
and ul.nav would be:
<ul class="nav">
<li></li>
</ul>
so "use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?" will be:
$("ul.nav li");
Bella Ratmelia
Front End Web Development Techdegree Graduate 28,947 Points$(".nav ul li");
the above can be translated as "li inside ul that is inside class of 'nav'."
ul with the class of nav should look something like this:
$("ul.nav");
Andrew Fu
1,477 Points"li inside ul that is inside class of 'nav'" -- is that the same thing as ALL li inside ul, or only ONE li inside ul?
Also, what exactly is the difference in html between ul.nav and .nav ul?
<!code> <div class="nav"> <ul> </ul> </div>
VS. ''' <div class="nav ul"></div> '''