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 trialed quijano
11,907 PointsPlease any suggestion about the challenge Jquery basics?
In this challenge: Remove the code that appends the button to the #menu, but keep the $button variable. I removed the lines: //Create button var $button = $("<button>Go</button>"); $("#menu").append($button);
but I get wrong the answer. This is the message that tell me is not the right action: Bummer! There was an error with your code: ReferenceError: Can't find variable: $button
Any suggestion that I am doing wrong? Plese help
2 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Ed,
You have the following code:
//Create button
var $button = $("<button>Go</button>");
$("#menu").append($button);
The challenge wants you to keep the $button variable and only remove the code that appends the button to the menu. You have removed all of it and so the $button variable doesn't exist anymore. This is what the error is telling you.
You only want to remove the line that appends the button.
ed quijano
11,907 PointsThanks J. It works.
Jason Anello
Courses Plus Student 94,610 PointsYou're welcome.