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: Challenge 5/5.

As soon as I get to question 5 it tells me that my answer for the second challenge is no longer valid. Is this a bug because I have tried everything.

7 Answers

Peaches Newbold on task three you don't need to use .select() I'm not sure if it is a jquery shortcut but just doing $(".removable") will select it like a CSS selector.

Second $("this") does not need to be in quotes. I believe this is because it is like a javascript function and has reserved special characters.

Last .remove(){}; does not need the curly braces{ }. Because it is a jquery shortcut which only use parentheses().

Does that all make sense? Either way hope that helps.

Can you paste your code and a link to the challenge that your on.

This is my code for task 2:

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

I passed this.

This is the link for task 5: http://teamtreehouse.com/library/websites/build-an-interactive-website/introduction-to-jquery/including-jquery-in-our-project-2

This is my code:

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

Once I have done this it says that task 2 is no longer passing.

I went back and tried a few things including:

  $("#message").hide().show("slow"){};

Please tell me what I am doing wrong, I want to be sure that I understand jquery as I move along.

Thanks for your help. I just tried the challenge again and didn't even give it an answer just to see what it would say. Once again it is saying that task 2 is no longer passing. Not that something was left out, just that task 2 is no longer passing. When I put an answer it it says null.

If the answer is wrong why doesn't it say what is missing, why when I leave it blank does it just say that task 2 is no longer passing as if that is some default answer ?

I believe Andrew Chalkley is working on refining the jquery stages. Just hang in there (and don't always trust the hint... which I'm sure you have figured out by now).

Actually when it is "null" that means there is an error in the code.

Yes thanks for your response I will move on to the next stage and come back to this to hopefully obtain this badge. If it was just null I would have just kept tinkering with the code. But when I didn't answer and it still wanted me 2 return to task 2 I just smiled. Once again thank you and I hope to pass this in the near future.

Okay kept messing around with this and finally passed. I used: $(this).remove();

I tried this before and it didn't work, but it worked this time whooooo!!!