Textarea valueProperty

Textarea 对象参考手册Textarea Object


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 »


Textarea 对象参考手册Textarea Object

Other Extensions