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 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>