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
sandygomez
2,498 Pointscorrect ways to markup a form in HTML5
for example I see some forms with a ID, Name and value? some only Name or ID : input type="text" id="name" name="user_name" (OR) input type="text" name="lastname"
sandygomez
2,498 PointsThanks for the clarification
Brandon Ogle
7,714 PointsBrandon Ogle
7,714 PointsIt depends on what you want to do. If you need to call that form field in your CSS or JavaScript you'd give it an ID. But if you didn't, you can leave that off. You will generally want a "name" b/c that's the name of the variable that the field captures and you usually need that for whatever backend receives the data (PHP script for ex). "value" you usually don't need on an input field b/c that gets entered by the user, but sometimes you want to set them up with a default value.