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

MUSTAFA DIRIK
MUSTAFA DIRIK
15,023 Points

what is the right code for this challenge?

i couldnt manage this challenge. what is the right code for this challenge?

js/app.js
//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
index.html
<!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>

Can 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

3 Answers

Also, if you can't solve a challenge, re-watching videos always help.

MUSTAFA DIRIK
MUSTAFA DIRIK
15,023 Points

yes i tried many times and asked after failed.. anyway thanks..

Can you show me your real code?

I believe your question up on the top of this website doesn't have your code.

MUSTAFA DIRIK
MUSTAFA DIRIK
15,023 Points

i 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");

If 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.