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

set that text input to contain "hello world".

Need help!

index.html
<!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>Item 1</li>
        <li>Item 2</li>
        <li>Item 3</li>
      </ol>
      <p>A wild<strong>paragraph</strong>appears.</p>
      <form>
      <input type="text">
      </form>

    </div>



  </body>
</html>
Jason Egipto
Jason Egipto
9,185 Points

Hey, try this:

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

Goodluck!

2 Answers

Steven Parker
Steven Parker
231,261 Points

Use the value attribute to give you input box initial contents.

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

Jason's example of using the placeholder attribute will make the text appear in the box, but it won't count as content.

Eugene Hamric
PLUS
Eugene Hamric
Courses Plus Student 273 Points

Here is the answer in full.

<!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>Apples</li>
    <li>Bananas</li>
    <li>Grapes</li>
  </ol>
  <p>I want to <strong>get me some chocolate</strong> now</p>
  <form>
    <input type="text" value="Hello World">
  </form>

</div>

</body> </html>