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