X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Textarea value Property

Textarea Object Reference Textarea Object

Example

Change the contents of a text area:

document.getElementById("myTextarea").value = "Fifth Avenue, New York City";

Try it yourself »


Definition and Usage

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

Internet Explorer Firefox Opera Google Chrome Safari

The value property is supported in all major browsers.


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;

The result of x will be:

342 Alvin Road
Ducksburg

Try it yourself »


Textarea Object Reference Textarea Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook