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

jamaleh gyulay
jamaleh gyulay
1,794 Points

I'm not really sure what this checkpoint is asking me to do??

I know that I need to use the .val() method, but not sure where or how.

1 Answer

Luke Towers
Luke Towers
15,328 Points

The challenge is asking you to add in code that will allow the h1 tag ($previewTitle) to automatically update as the user is typing into the $titleInput field.

There is already a function (updatePreview()) set up to do this, you just need to put the code that gets the value of the $titleInput into that function so that when the function runs it will grab the value of $titleInput and set the content of $previewTitle to that value.

jamaleh gyulay
jamaleh gyulay
1,794 Points

I've been trying to do this:

$previewTitle.val(titleValue);

but its not working.