Change the default value of a text area:
The defaultValue property sets or returns the default value of a text area.
Note: The default value of a text area is the text between the <textarea> and </textarea> tags.
The defaultValue property is supported in all major browsers.
Return the defaultValue property:
Set the defaultValue property:
Value | Description |
---|---|
text | Specifies the default value (contents) of the text area |
Return Value: | A String, representing the default value of the text area |
---|
Get the default value of a text area:
The result of x will be: