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 trialChristopher Sea
3,726 PointsAdd text input to form.
The task is to add a text input to a form. The task prior to this one was to add a form tag, which was done correctly; so I know the problem isn't the form tag. I'm not sure what is wrong with my text input. Can someone check this?
Christopher Sea
3,726 Points<form>
<input type=βtextβ name=βusernameβ>
</form>
Ryan Duchene
Courses Plus Student 46,022 PointsHmm, that looks okay to me. Let me try running through the challenge myself.
3 Answers
Ryan Duchene
Courses Plus Student 46,022 PointsOkay, I think it might be a quirk with the challenge. I don't think it wants the name
attribute you have, just the type=
"text
" part. This should pass the rest of the challenge:
<form>
<input type="text" value="Hello World">
</form>
Happy coding!
Christopher Sea
3,726 PointsDo you know why the value attribute was needed here? It wasn't discussed in the video. Also, there was a question on the Quiz about which statement was correct for adding a text input. The correct answer didn't have a value attribute here either.
Jeremy Canela
Full Stack JavaScript Techdegree Graduate 30,766 PointsTo create an input field, just create a tag called input and specify the type of input. Example:
<form action="">
<input type="text">
</form>
Christopher Sea
3,726 Points<form action=""> <input type="text"> </form>
I tried this first, but it was wrong.
<form action=""> <input type="text" value="Hello World"> </form>
Not sure why, but this was correct. Thank you.
Jeremy Canela
Full Stack JavaScript Techdegree Graduate 30,766 PointsIf you'd like to learn more about input types and attributes here's a link: Link :)
Ryan Duchene
Courses Plus Student 46,022 PointsRyan Duchene
Courses Plus Student 46,022 PointsCan you paste your code here for us to see? :)