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

SZE SZE XU
9,759 Pointshow is "id" different from "name" in html form, they both refer to the description of the entry.
how is "id" different from "name" in html form, they both refer to the description of the entry.
I am confused why there are two parameter
2 Answers

Steven Parker
242,770 PointsEvery ID on the page must be unique, no two elements can have the same ID. ID's are useful for selecting elements in CSS or JavaScript.
*Name*s, on the other hand, are primarily used with form input fields. Names can be shared, and it can be helpful to do so. For example, several radio buttons can share the same name, and only the value of the selected one will be associated with that name when the form is submitted.

alastair cooper
30,618 Pointsid references the element for CSS. The name attribute is passed to the server as a variable when the form is submitted. It can then be used by back-end languages such as php, ruby, etc