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

True Andrews
seal-mask
.a{fill-rule:evenodd;}techdegree
True Andrews
Front End Web Development Techdegree Student 9,045 Points

Not sure what I'm doing wrong

What am I doing wrong, what steps

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

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

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

    <script
    src="jquery-3.2.1.min.js"></script>
    <script src="app.js"></script>
</body>
</html>
app.js
const $show = $(div, li:hidden);
$show.show();

2 Answers

Fran ADP
Fran ADP
6,288 Points

reveal just the hidden the div.

Steven Parker
Steven Parker
203,990 Points

No, not the div. Just the list items. The instructions say "... while leaving the <div> element hidden". :see_no_evil:

Steven Parker
Steven Parker
203,990 Points

you're on the right track, but I see 3 issues:

  • the instructions say to reveal just the hidden li's, not the div
  • the selector must be enclosed in quotes
  • use method chaining to avoid creating a variiable