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.

JavaScript jQuery Basics Understanding jQuery Events and DOM Traversal Spoiler Revealer: Breaking it Down

Sam Alcaraz
Sam Alcaraz
6,637 Points

need help

in index.html <p class="spoiler"> <span>Darth Vader is Luke Skywalker's Father! Noooooooooooo!</span> <button>Reveal Spoiler</button> </p> <script scr="js/jquery-3.2.1.min.js"></script> <script src="js/app.js"></script> </body> </html>

thats in app.js $('.spoiler span').hide();

its saying theres an error with the $ not being identified

4 Answers

When calling in the jquery javascript file, it seems like you misspelled "src".

Munish Sharma
seal-mask
.a{fill-rule:evenodd;}techdegree
Munish Sharma
Full Stack JavaScript Techdegree Student 5,144 Points

<p class="spoiler"> <span>Darth Vader is Luke Skywalker's Father! Noooooooooooo!</span> <button>Reveal Spoiler</button> </p> <script sRc="js/jquery-3.2.1.min.js"></script> <script src="js/app.js"></script> </body> </html>

I changed it where is the mistake. I hope It help.

Hey there, this code below includes the src attribute. This will allow you to load the jQuery library before your jQuery code in app.js. Hope this helps.

<body>
    <img src="img/deathstar.png" />
    <p class="spoiler">
        <span>Darth Vader is Luke Skywalker's Father! Noooooooooooo!</span>
    <button>Reveal Spoiler</button>
    </p>
<!-- Include the src attribute in the script tag -->
  <script src="js/jquery-3.2.1.min.js"></script>
  <script src="js/app.js"></script>
</body>