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

Code Challenge: Including JQuery in our Project

I have mentioned this twice before and it still doesn't work. Every time I complete Task 4 it tells me to go back to Task 2 and sometimes it does that with Task 3. Here is my code for Tasks 1-4:

Task 1:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript"></script>

Task 2:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
  $('#message').hide();
  $('#message').show('slow');
</script>

Task 3:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
  $('#message').hide();
  $('#message').show('slow');
  $('.removable')
</script>

Task 4:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
  $('#message').hide();
  $('#message').show('slow');
  $('.removable').click(function();{
   });
</script>

Please get back to me quickly

2 Answers

Chase Lee
Chase Lee
29,275 Points
.hide().show('slow');

Ok thank you very much for your help

Chase Lee
Chase Lee
29,275 Points

Take out the semicolon right after the parenthesis here:

$('.removable').click(function(){ });

Also try string the .hide() and the .slow() methods together.

How do I string the hide and slow together?

You need to chain them together like this:

$('#message').hide().show('slow');