Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
212,140 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>