# HTML DOM Textarea Object

« Previous
Next Reference »

## Textarea Object

The Textarea object represents an HTML <textarea> element.

### Access a Textarea Object

You can access a <textarea> element by using getElementById():

var x = document.getElementById("myTextarea"); Try it

Tip: You can also access a <textarea> element by searching through the elements collection of a form.

### Create a Textarea Object

You can create a <textarea> element by using the document.createElement() method:

var x = document.createElement("TEXTAREA"); Try it

## Textarea Object Properties

= Property added in HTML5.

Property | Description
--- | ---
autofocus | Sets or returns whether a text area should automatically get focus when the page loads
cols | Sets or returns the value of the cols attribute of a text area
defaultValue | Sets or returns the default value of a text area
disabled | Sets or returns whether the text area is disabled, or not
form | Returns a reference to the form that contains the text area
maxLength | Sets or returns the value of the maxlength attribute of a text area
name | Sets or returns the value of the name attribute of a text area
placeholder | Sets or returns the value of the placeholder attribute of a text area
readOnly | Sets or returns whether the contents of a text area is read-only
required | Sets or returns whether the text area must be filled out before submitting a form
rows | Sets or returns the value of the rows attribute of a text area
type | Returns the type of the form element the text area is
value | Sets or returns the contents of a text area
wrap | Sets or returns the value of the wrap attribute of a text area

## Textarea Object Methods

Method | Description
--- | ---
select() | Selects the entire contents of a text area

## Standard Properties and Events

The Textarea object also supports the standard properties and events.

## Related Pages

HTML tutorial: HTML Forms

HTML reference: HTML <textarea> tag

« Previous
Next Reference »

### WEB HOSTING

UK Reseller Hosting

### WEB BUILDING

FREE Website BUILDER Free HTML5 Templates

### W3SCHOOLS EXAMS

HTML, CSS, JavaScript, PHP, jQuery, XML, and ASP Certifications

### SHARE THIS PAGE

### Color Picker

### HTML/CSS

HTML Tutorial HTML5 Tutorial CSS Tutorial CSS3 Tutorial Bootstrap Tutorial

### JavaScript

JavaScript Tutorial jQuery Tutorial jQuery Mobile Tutorial AngularJS Tutorial AJAX Tutorial JSON Tutorial

### Graphics

Canvas Tutorial SVG Tutorial Google Maps Tutorial

### Server Side

SQL Tutorial PHP Tutorial ASP Tutorial ASP.NET Tutorial VBScript Tutorial AppML Tutorial

### Web

Web Building Web Statistics Web Certification

### XML

XML Tutorial DTD Tutorial Schema Tutorial XML DOM Tutorial XPath Tutorial XSLT Tutorial XQuery Tutorial XSL-FO Tutorial RSS Tutorial WSDL Tutorial

### HTML/CSS

HTML Tag Reference HTML Event Reference HTML Color Reference CSS 1,2,3 Reference Bootstrap Reference

### JavaScript

JavaScript Reference HTML DOM Reference jQuery Reference jQuery Mobile Reference Google Maps Reference

### Server Side

PHP Reference SQL Reference ASP Reference VBScript Reference Razor Reference ASP.NET Reference

### XML

XML DOM Reference XSLT Reference XSL-FO Reference XPath Reference XQuery Reference Schema Reference RSS Reference SVG Reference

### HTML Charsets

HTML Character Sets HTML ASCII HTML ANSI HTML Windows-1252 HTML ISO-8859-1 HTML Symbols HTML UTF-8

### HTML/CSS

HTML Examples CSS Examples

### Browser Scripting

JavaScript Examples HTML DOM Examples jQuery Examples jQuery Mobile Examples AngularJS Examples AJAX Examples

### Server Scripting

PHP Examples ASP Examples VBScript Examples Razor Examples .NET Examples

### XML Languages

XML Examples DTD Examples XML DOM Examples XSL Examples XSLT Examples XPath Examples XQuery Examples Schema Examples RSS Examples SVG Examples