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 trialSkanktron 2000
6,054 PointsSet that text input to contain "Hello world"
i have tried this many times not able to fine the solution i have enterd <input type="text" name="message" value="Hello world"> and i have also tried <input type="text" name="message" value="Hello world">Hello world<br>
But i got the same error try setting the 'value' attribute on the text input
can anyone help me out please i am struck here
3 Answers
Tobias Helmrich
31,603 PointsHey,
could you please post your code so I can see where the mistake might be? :)
To set the value of an input to a text you have to set the value attribute of the input to this text. Also take care that you write the W in "World" in uppercase.
Like so:
<input type="text" value="Hello World">
I hope that helps you to solve the challenge, good luck! :)
Skanktron 2000
6,054 Points<html> <head> <title>HTML Mastery Challenge</title> </head> <body> <h1>HTML Mastery Challenge</h1>
<div>
<h2>Shopping List</h2>
<ol>
<li>Fruits</li>
<li>Clothes</li>
<li>Shoes</li>
</ol>
<p><strong>Text is in Bold</strong></p>
<form>
<input type="text" name="Mark">
<input type="text" name="Message" value="Hello World">
</form>
</body>
</html>
hey i have tried this but i am getting the same error can u please help me out ""Try setting the 'value' attribute on the text input""
This is the error i got
Thank you for your quick response
Tobias Helmrich
31,603 PointsHey, actually it should work if you use the code I posted above for the input tag. Could you please post the whole code? :)
Skanktron 2000
6,054 Pointsi have posted the whole code cant u scroll it down
Skanktron 2000
6,054 Points<html>
<head>
<title>HTML Mastery Challenge</title>
</head>
<body>
<h1>HTML Mastery Challenge</h1>
<div>
<h2>Shopping List</h2>
<ol>
<li>Fruits</li>
<li>Clothes</li>
<li>Shoes</li>
</ol>
<p><strong>Text is in Bold</strong></p>
<form>
<input type="text" name="Mark">
<input type="text" name="Message" value="Hello World">
</form>
</body>
</html>
Skanktron 2000
6,054 Pointsi have posted the whole code again have you got it
Tobias Helmrich
31,603 PointsYes, I've got it. I'm sorry, I thought that wasn't the whole code. However take care that you format your code correctly because your code stops after the ordered list. :) About which task are you talking about in particular?
Tobias Helmrich
31,603 PointsAh, now it's properly formatted, alright! Have you tried removing the first input element? I think the challenge only wants you to have one input element.
Try removing this:
<input type="text" name="Mark">
so you just have this input element
<input type="text" name="message" value="Hello World">
in your code.
Skanktron 2000
6,054 Pointsya got it thanks alot for your help
Tobias Helmrich
31,603 PointsNo problem, always happy to help!