Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed jQuery Basics!
You have completed jQuery Basics!
Preview
Use the val() method to retrieve data from an HTML form field.
Further Reading
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
But what if we wanna get and
do something with information from a user?
0:00
To build this blog previewer, we'll want a
user to be able to fill out this form and
0:01
when they click on this preview button,
0:06
display what was entered
over here on the right.
0:08
The HTML and text methods can't be used
to get information from form inputs
0:12
such as text inputs and text areas.
0:16
So how would we get and
preview information from a user?
0:20
We can do this with jQuery's val method.
0:23
Let's go back to app.js.
0:26
Right now, we've got some baked
in values for the preview.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up