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

Ms Na W
Ms Na W
5,776 Points

jQuery Basics- Challenge 1: Unexpected AST node type passed to processExpressionStatement method: VariableDeclaration

I don't understand why my code is not right. Looking at the preview, it looks like the two list items re appearing so what's wrong?

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 $hidden = $('li:hidden');
$hidden.show();

1 Answer

Ms Na W
Ms Na W
5,776 Points

Thank you- that worked, I just wasn't sure why my code didn't.