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

JavaScript jQuery Basics Working with jQuery Collections Working with jQuery-Specific Selectors

Result right, error message when checked

Hi, the "check work" results says that my variable declaration is wrong. However, I get the right result and the hidden elements are shown. What is wrong? Thank you for help!

const $hiddenElement = $(':hidden'); $hiddenElement.show();

3 Answers

Antti Lylander
Antti Lylander
9,686 Points

two problems:

  1. the validation does not like declaring a variable. Don't declare any variable.
  2. select only the list items that are hidden
Adam Beer
Adam Beer
11,314 Points

Challenge Task 1 of 1

There are three hidden items on this page-- a div and two list items. Use jQuery's :hidden pseudo selector to select only the hidden list items. Then use the show() method to expose the hidden elements.

So the first step, select the hidden list items. Second step, write this in a row and use "show()" method. You are so close, but you haven't selected the list items.

Now I got the following and it worked out:

$('li:hidden').show();

Thanks everyone!