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 mastery task 7 of 8

Asking me to "Set that text input to contain "Hello World"" Not exactly sure what they want. Any help is appreciated, thanks.

6 Answers

Ross King
Ross King
20,704 Points

Hi Brent,

Below is the answer. The text input is assigning a value to the form input.

Hope this helps!

<!DOCTYPE html> <html> <head> <title>HTML Mastery Challenge</title> </head> <body> <h1>HTML Mastery Challenge</h1>

<!-- Write your code below -->
    <div>
  <h2>Shopping List</h2>
    <ol>
      <li></li>
      <li></li>
      <li></li>
  </ol>
  <p>Add a paragraph tag that has some text inside of it <strong>bolded</strong></p>
</div>

<form action="#">
  <input type="text" value="Hello World"> <!--Set that text input to contain "Hello World"-->
</form>

</body> </html>

Thanks for this—I couldn't figure out exactly what they wanted either. I kept throwing more and more code at it, got frustrated, came here and....duh. Simple. Thanks again.

<form> <input type="text" value="Hello World"> </form>

For "text", "password", and "hidden" - it defines the initial (default) value of the input field.

They're looking for you to set it up so that the input text box has the words "Hello World" in it before the user inputs anything.

w3schools.org

An attribute you might use to accomplish a similar effect that isn't covered here: placeholder attribute: w3schools.org

the input tag has many type ,such as type="text",type="hidden",type="password",maybe you can try it and sometimes when you set a input tag ,you also have to give it a value, so you will see the input tag and got a value called "hello world"

You are probably look for the value attribute. The placeholder attribute does something similar.

http://www.htmldog.com/reference/htmltags/input/

Here is the answer for 7 of 8. under <form> <input type="text"name="Hello World" value="Hello World"> </form>