Reputation: 557
How can one use jQuery to select list items from an unordered list that has a specific class? The exact question reads "On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?"
I have tried several times on treehouse but it won't let me pass!
$(".nav ul li");
Upvotes: 6
Views: 4207
Reputation: 148110
Your selector $(".nav ul li")
means some element with class nav has ul
, if ul has class nav then try this
.
$("ul.nav li");
Upvotes: 12