Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Build an Interactive Website Introduction to jQuery Using jQuery to Select Elements

Is Code Challenge Incorrect?

Seems like a very easy code challenge but???

On the next line, use jQuery to select all list items (li) in an unordered list (ul) with the class of 'nav'?

$("#container"); $(".nav ul li");

but when I check my answer i get the following result

Bummer! Enter the string of the CSS selector for all li elements in a ul element with the class of 'nav'

6 Answers

This caught me out to. You basically need to select the ul with the class of .nav and then the listed items within that class.

$('ul.nav li')

Just a case of getting it in the right order.

Claire

Thanks for the information, thats about the only order I didn't try! Also another quick question how do you copy the screen from the challenge to the forum post like you did in your message?

Thanks for the information, thats about the only order I didn't try! Also another quick question how do you copy the screen from the challenge to the forum post like you did in your message?

Glad I could help. If you mean how to put code into a forum post you basically want to put 3 backticks on the line before the start of your code and on the line after the code. (''') Check out the "markdown cheetsheet" that's linked under the box you comment in on the forum. Hope that helps and makes sense :)

Alan Bothe
Alan Bothe
14,352 Points

Same here Steve. I tried everything EXCEPT this. I'm pretty sure that's not the normal CSS syntax and the video didn't cover it.

Alan

I agree it doesn't look like normal CSS to me either