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 Perform: Part 1

Rebecca Jensen
Rebecca Jensen
11,580 Points

Seeing the string '$select' instead of an empty dropdown menu

I'm supposed to be able to see an empty dropdown menu after writing this code, but I'm seeing the empty string '$select' appear instead. Is that okay (for now)?

Here's my workspace snapshot: https://w.trhou.se/m0zcpx3w30

And my JavaScript:

const $select = $('<select></select>');
$('#menu').append('$select');
Rebecca Jensen
Rebecca Jensen
11,580 Points

Aa! Of course, I put '$select' in quotes, and it should not be! Fixed it.

1 Answer

Steven Parker
Steven Parker
231,275 Points

Variable names should not be enclosed in quotes.

It looks like you resolved your issue already. Good job! :+1: