Textarea value Property
Example
Change the contents of a text area:
document.getElementById("myTextarea").value = "Fifth Avenue, New York City";
Try it Yourself »
Description
The value property sets or returns the contents of a text area.
Note: The value of a text area is the text between the <textarea> and </textarea> tags.
Browser Support
Property | |||||
---|---|---|---|---|---|
value | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the value property:
textareaObject.value
Set the value property:
textareaObject.value = text
Property Values
Value | Description |
---|---|
text | Specifies the value (contents) of the text area |
Technical Details
Return Value: | A String, representing the contents/text of the text area |
---|
More Examples
Example
Get the contents of a text area:
var x = document.getElementById("myTextarea").value;
Try it Yourself »
❮ Textarea Object