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 Introduction to jQuery Hello, jQuery! The jQuery Object

Something wrong ?

Following along with the code on workspace, but nothing happens when i preview the page ?

Jquery

$('li').on('click', function() {
  $(this).text("Clicked!").delay(800).fadeOut(400);
});

HTML mark up below

<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <ul>
      <li>Thing 1</li>
      <li>Thing 2</li>
      <li>Thing 3</li>
    </ul>
    <script src="app.js"></script>
  </body>
</html

1 Answer

Sarah Stensberg
seal-mask
.a{fill-rule:evenodd;}techdegree
Sarah Stensberg
Full Stack JavaScript Techdegree Student 5,006 Points

I don't think the workspaces load jQuery by default. Add the following script tag to the end of your body tag, before your external .js file, like this:

<script
  src="https://code.jquery.com/jquery-3.2.0.js"
  integrity="sha256-wPFJNIFlVY49B+CuAIrDr932XSb6Jk3J1M22M3E2ylQ="
  crossorigin="anonymous">
</script>
<script src="app.js"></script>
</body>

It works ! thanks sarah