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

Loftur Einarsson
Loftur Einarsson
3,591 Points

Doesn't fade out

<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <ul>
      <li>Thing 1</li>
      <li>Thing 2</li>
      <li>Thing 3</li>
    </ul>
    <script
  src="https://code.jquery.com/jquery-3.2.0.js"
  integrity="sha256-wPFJNIFlVY49B+CuAIrDr932XSb6Jk3J1M22M3E2ylQ="
  crossorigin="anonymous">
</script>
    <script src="app.js"></script>
  </body>
</html>
$('li').on('click', function() {
 $(this).text("Clicked!").delay(800).fadeout(400);
});
Loftur Einarsson
Loftur Einarsson
3,591 Points

console:

app.js:2 Uncaught TypeError: $(...).text(...).delay(...).fadeout is not a function
    at HTMLLIElement.<anonymous> (app.js:2)
    at HTMLLIElement.dispatch (jquery-3.2.0.js:5206)
    at HTMLLIElement.elemData.handle (jquery-3.2.0.js:5014)

2 Answers

Andreas Nyström
Andreas Nyström
8,887 Points

The function is called fadeOut with a big "O".

$(this).text("Clicked!").delay(800).fadeout(400);

should be:

 $(this).text("Clicked!").delay(800).fadeOut(400);
Andreas Nyström
Andreas Nyström
8,887 Points

Anytime, if it helped please select the solution as best answer. :-)