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

HTML

what is the name attribute for?

Hi Guys

I wanted to know that why do we have the name attribute in our form inputs when we already have id

Thanx

2 Answers

Mason Frye
Mason Frye
8,870 Points

The name attribute is used in PHP to access specific inputs using the name.

so its not used for html and css

Thanx

Mason Frye
Mason Frye
8,870 Points

No. Unless you are using php with a form, the name attribute is not useful