<textarea name="">

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Attribute of
HTML5 Textarea Attributes: Here's What You Should Know
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.
Adam is a technical writer who specializes in developer documentation and tutorials.