Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

jquery query

Stuck on a code challenge and can't figure out what I'm doing wrong.

https://teamtreehouse.com/library/jquery-basics/creating-a-mobile-drop-down-menu/setting-a-value

This is the code I am writing and I keep getting the "bummer" notification.

//Select Input with the id of #fullName $( "#fullName" ).val();

I've checked the docs and asked a few friends but I can't find the problem.

Any ideas?

3 Answers

Hey Andrea, you're doing everything right except passing a value.. The question is worded funny because the answer only needs to be on one line and it separates the question into two.

//Show Prompt Window and store value var fullName = prompt("What is your full name?");

//Select Input with the id of #fullName $("#fullname).val(); <---- this is correct, you've selected the input with the id of #fullName //Insert value in to full name input <-----this is what you didn't do

** The value you need to insert is the text from the prompt dialog box, which is stored where? In the var fullName ** SO, the value you need to insert is? fullName

Final Answer: $("fullName").val(fullName);

Hope this helps!

$('#fullName').val(fullName);

Make sure to use the # selector otherwise jQuery doesn't know you want to target an ID a will instead look around for the <fullName> tag.

Cheers guys,

The help is much appreciated. :)

Thanks falk sorry bout the typo!