Textarea value attribute
Definition and Usage
value
Sets or returns the content of the text area.
Note:The value of the text area is the text between the <textarea> and </textarea> tags.
Instance
Example 1
Change the content of the text area:
document.getElementById("myTextarea").value = "Fifth Avenue, New York City";
Example 2
Get the content of the text area:
var x = document.getElementById("myTextarea").value;
Syntax
Return value attribute:
textareaObject.value
Set value attribute:
textareaObject.value = text
Attribute Value
Value | Description |
---|---|
text | Specifies the value (content) of the text area. |
Technical Details
Return Value: | A string value representing the content/text of the text area. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |