The name attribute on a <textarea> tag assigns a name to that textarea.
This name is used during form submission and as a reference for other purposes.
A name attribute on a <textarea> element.
The textarea value (the text) is sent during form submission.
<form action="/tutorial/action.html">
<label>Enter your message</label> <br />
<textarea name="message" rows="3" cols="55">
</textarea>
<br />
<input type="submit" value="Submit">
</form>
The name attribute specifies the textarea element's name.
Unlike id, the name does not have to be unique across the page.
This attribute can be used as reference for CSS, JavaScript, and form data after submitted.
Note: Only textarea elements with name attribute will be submitted as form data.
<textarea name="name">
name | Description |
---|---|
name | Sets the textarea element's name. |
Here is when name support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <textarea>