Textarea valueProperty
Examples
Modify the text content of the textarea:
document.getElementById("myTextarea").value = "Example";
Try it Yourself »
Definition and Usage
The value property sets or returns the text of a textarea.
Syntax
Set the value property:
textareaObject.value="text"
Return the value property:
textareaObject.value
Property Values
| Value | Description |
|---|---|
| text | Specifies the content of the text field |
Browser Support
| Property | |||||
|---|---|---|---|---|---|
| value | Yes | Yes | Yes | Yes | Yes |
Examples
Examples
Get the text content of the textarea:
var x = document.getElementById("myTextarea").value;
Try it Yourself »
Other Extensions
Textarea Object