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 jQuery Basics (2014) Creating a Mobile Drop Down Menu Perfect

Please 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

Hi 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.

Thanks J. It works.

You're welcome.