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 trialMUSTAFA DIRIK
15,023 Pointswhat is the right code for this challenge?
i couldnt manage this challenge. what is the right code for this challenge?
//Show Prompt Window and store value
var fullName = prompt("What is your full name?");
//Select Input with the id of #fullName
//Insert value in to full name input
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<label for="fullName">Full Name</label><input id="fullName" name="fullName" value="" disabled>
<script src="//code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
3 Answers
Alexander Davison
65,469 PointsAlso, if you can't solve a challenge, re-watching videos always help.
MUSTAFA DIRIK
15,023 Pointsyes i tried many times and asked after failed.. anyway thanks..
Alexander Davison
65,469 PointsCan you show me your real code?
I believe your question up on the top of this website doesn't have your code.
MUSTAFA DIRIK
15,023 Pointsi tried some different code alternatives. and deleted after both didnt passed.
1- //Show Prompt Window and store value var fullName = prompt("What is your full name?");
//Select Input with the id of #fullName $fullName.append("fullName"); //Insert value in to full name input $fullName.val("input");
2- $fullName.val("input");
3- $selected.append("fullName"); $fullName.val("input");
Andrew McPheron
14,290 PointsIf you're trying to select the variable's jquery object, you use the format $(target).method(input). So for instance, you have
#fullName $fullName.append("fullName"
But this doesn't fit the general formula. You're probably looking for something like this:
$(#fullname).append(fullName)
So to break that down, $ loads the jquery version, (#fullname) is the targetted object to modify with append() or val() or whatever. What goes inside those methods will be the input or new data, such as the data stored in your fullName variable.
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsCan you at least try? The Community isn't for asking for answers :)
The Community is for asking questions about learning, and asking for help on code you've already written.
I hope you understand. ~Alex