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 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!