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 HTML Forms Form Basics The Button Element

Pratik Rai
Pratik Rai
6,856 Points

is name attribute very important?

I just have a simple question. Is 'name' attribute very important?

4 Answers

Kevin Korte
Kevin Korte
28,148 Points

Because later, when your form sends data to the server, it'll be referenced on the server by it's name attribute from the form.

Daniel Botta
Daniel Botta
17,956 Points

Yes it's very important when working with server side code. For example, when someone types text into an input and you want to do something with that data, you would access that data from the name value in order to do something with it.

Pratik Rai
Pratik Rai
6,856 Points

thank you. since I have no idea about server side, so didn't know about that. I always used to write without name attribute. now onwards i will put name as well.