Attribute of
What does <textarea name=""> do?
Adds a name attribute to a <textarea> element and associates the name with the text added to the text area.

Code Example

<textarea name="opinion" placeholder="What do you think?"></textarea>

What's in a name?

The name attribute is a global attribute that can be used on many different HTML elements. When applied to a textarea the attribute is automatically associated with the value submitted with that form field, and can then be used to reference the data associated with the name.

Isn't a name the same as an id?

One point of confusion that often comes up when dealing with HTML forms is the difference between name and id attributes. While the two attributes are similar in some ways, they are also different in some very important ways.

  • IDs can only be used once in an HTML document while names can be applied to multiple elements.
  • Names are attached to the value submitted in a form field while IDs are not.