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 trialCary Oldenkott
8,178 PointsDrop down menu not showing any text
After following the video step by step, when I go to preview my code, the drop down menu does not show the menu text.
var $select = $("<select></select>");
$("#menu").append($select);
$("menu a").each(function() {
var $anchor = $(this);
var $option = $("<option></option>");
$option.val($anchor.attr("href"));
$option.text($anchor.text());
$select.append($option);
});
4 Answers
Cary Oldenkott
8,178 PointsSorry, found the problem. I forgot the hashtag on menu on the append method on the second line
Lea Ingold
11,841 PointsThank you, Cary!
Nikola Mitic
9,023 PointsI just spent 45 minutes trying to get my code to work, ahhh hate when this happen. Anyway thanks, have the same miss type as you.
James Delaplain
5,872 PointsI had my Index page sourcing wrong as last video was working with src="http://code.jquery.com/jquery-1.11.3.min.js" not "src="http://code.jquery.com/jquery-1.11.0.min.js"
Margaret Godowns
6,268 PointsMargaret Godowns
6,268 PointsI did the same thing -- glad you caught this!