Textarea name property
Example
Get the name of the textarea:
var
x
=
document
.
getElementById
(
"
myTextarea
"
)
.
name
;
Try it »
Definition and Usage
The name property sets or returns the name of the textarea.
Browser support
| property | |||||
|---|---|---|---|---|---|
| name | Yes | Yes | Yes | Yes | Yes |
Syntax
Set the name attribute:
textareaObject.name = text
Return the name attribute:
textareaObject.name
**Note:** The name property has no default value.
Attribute values
| Value | Description |
|---|---|
| text | Specifies the name of the textarea |
Technical Details
| Return value: | String, representing the name of the textarea text box. |
|---|
More examples
Example
Modify the name of the textarea text box:
document
.
getElementById
(
"
myTextarea
"
)
.
name
=
"
newTxtName
"
;
Try it »
The Textarea object