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 trialJade Hudson
6,859 PointsI've been stuck on this one for about an hour can anybody explain what this one is all about? And help me?
Any help would be most appreciated.
What is this question all about.
1 Answer
Luke Pettway
16,593 PointsIt looks like it is asking for you to use the prompt value and assign it to a variable. Then after that you need to select the input you want to add the value to, which you can simply use a variable which it is assigned to. Finally, you need to use the val() function to add the value of the first variable (fullName) to it. This is what I did:
//Show Prompt Window and store value - Takes the value from the prompt and assigns it to fullName
var fullName = prompt("What is your full name?");
//Select Input with the id of #fullName - assigns the dom object of the input with the id of #fullName to the input //variable
var input = $('#fullName');
//Insert value in to full name input - uses the val() function to change the value of $('fullName') to the input
input.val(fullName);
LaVaughn Haynes
12,397 PointsLuke is correct.
You are getting the value returned from the prompt. For example: var fullName = "Jade";
var fullName = prompt("What is your full name?");
Then selecting the input (the "fullName" text field) from the form with jQuery $('#fullName')
<input id="fullName" name="fullName" value="" disabled>
...and adding the value to it $('#fullName').val(fullName)
<input id="fullName" name="fullName" value="Jade" disabled>
Jacob Mishkin
23,118 PointsJacob Mishkin
23,118 PointsPost the code you have done so far and let's take a look at it.