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 Setting a value

I'm lost on this challenge, jQuery: set a value. How do I select the correct input then set its value to the fullName?

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

//Select Input with the id of #fullName var $select = $("<select></select>"); $("#fullName").val($select); //Insert value in to full name input

1 Answer

Sergey Podgornyy
Sergey Podgornyy
20,660 Points

The val method is actually going to display value it needs the variable that's being passed into it.

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

So the first is the actual section of the required input element, jQuery is attaching the action to the input by its ID. Then the val() method is being called on it with a value.