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

Hanane Ladj
Hanane Ladj
Front End Web Development Techdegree Student 9,185 Points

Would anyone tell me what is wrong with my code please?

I am trying to solve this challenge but i didn't work. anyone can take a look at it please?

<!DOCTYPE html>
<html lang="en">
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <h2>Star Trek Characters</h2>

    <ul class="character-list">
        <li>Captain Jean Luc Picard</li>
        <li>Dr. Crusher</li>

    <div>I am supposed to stay hidden!</div>    

    <script src="app.js"></script>
const $list = $('li:hidden');

2 Answers

Rabin Gharti Magar
.a{fill-rule:evenodd;}techdegree seal-36
Rabin Gharti Magar
Front End Web Development Techdegree Graduate 18,799 Points

Hey Hanane Ladj,

For this challenge, you do not have to declare any variable. You can simply select hidden li using a : hidden pseudo-selector and then add .show() method.

Secondly, you need to hide div element, to do that you just need to select div and apply hide method.

Here's the final version:


Hope this helps!