Textarea value property
Example
Modify the text content of the textarea:
document
.
getElementById
(
"
myTextarea
"
)
.
value
=
"
Runoob
"
;
Try it »
Definition and Usage
The value property sets or returns the text of the textarea.
Syntax
Set the value attribute:
textareaObject.value="text"
Return the value attribute:
textareaObject.value
Attribute values
| Value | Description |
|---|---|
| text | Specifies the content of the text box |
Browser support
| property | |||||
|---|---|---|---|---|---|
| value | Yes | Yes | Yes | Yes | Yes |
Example
Example
Get the text content of the textarea:
var
x
=
document
.
getElementById
(
"
myTextarea
"
)
.
value
;
Try it »
The Textarea object