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

HTML HTML Forms HTML Mastery

SAMUEL LAWRENCE
PLUS
SAMUEL LAWRENCE
Courses Plus Student 8,447 Points

How to set text input to contain the text "Hello World"?

hi guys in this course on forms in the code challenge we were asked to create an input form and "Set that text input to contain "Hello World". but I went back over the entire course looked at the transcript and there was nothing on how to do that. does anyone know?in the tip it said "Try setting the 'value' attribute on the text input.' I did like so <form><input type="text" value="Hello World" /></form>. but i'm still getting it wrong.

2 Answers

You need to set the value attribute for the input field. This just sets the initial value of the field.

<input type="text" value="Hello World">
SAMUEL LAWRENCE
PLUS
SAMUEL LAWRENCE
Courses Plus Student 8,447 Points

I did that. However I think it was a browser problem. I kept trying the same thing over and over again cause i didn't understand why it didn't work, then it just did. thanks for your reply.

Same here. The input type and value are correct and appear correctly in the browser view but is identified as incorrect.