<TEXTAREA> | NN all IE all HTML all
<TEXTAREA>...</TEXTAREA> | HTML End Tag: Required
The textarea element is a multiline text input control primarily used inside form elements (required in Navigator 4 or earlier). Unlike the text type input element, a textarea element can be sized to accept more than one line of text. Word-wrapping is available on more recent browsers, and users may enter carriage return characters (a combination of characters ASCII decimal 13 and 10) inside the text box. When a textarea element is inside a submitted form, the name/value pair is submitted, with the value being the content of the text box (and the name attribute must be assigned). The CGI program on the server must be able to handle the possibility of carriage returns in the text data.

If you wish to display text in the textarea element when it loads, that text goes between the start and end tags; otherwise, there are no intervening characters in the source code between start and end tags. A label for the textarea element must be placed before or after the element, and may be encased in a label element for structural purposes (optionally in newer browsers).

Example
    <TEXTAREA rows="5" cols="60" name="notes">Use this area for extra notes.
    </TEXTAREA>
Object Model Reference
    [window.]document.formName.elementName
    [window.]document.forms[i].elements[j]
    [window.]document.getElementById(elementID)
Element-Specific Attributes

cols | datafld | datasrc | disabled | name
readonly | rows | wrap |  |

Element-Specific Event Handler Attributes

Handler | NN | IE | HTML
onafterupdate | n/a | 4 | n/a
onbeforeupdate | n/a | 4 | n/a
onchange | 2 | 3 | 4
onscroll | n/a | 3 | 4
onselect | 2 | 3 | 4

accesskey | NN 6 (see text) IE 4/5 HTML 4 (see text)
accesskey="character" | Optional
A single character key that either gives focus to an element (in some browsers) or activates a form control or link action. The browser and operating system determine if the user must press a modifier key (e.g., Ctrl, Alt, or Command) with the access key to activate the link. In Windows versions of IE 4 and later and Netscape 6, the Alt key is required and the key is not case-sensitive. For Macintosh versions of IE 5 and later and Netscape 6, the Ctrl modifier key is required to effect the action.

Although accesskey is listed here as a widely shared attribute, that isn't strictly the case across all implementations. HTML 4 and Netscape 6 recognize this attribute only for the following elements: a, area, button, input, label, legend, and textarea. To this list, IE 4 adds applet, body, div, embed, isindex, marquee, object, select, span, table, and td (but removes label and legend). IE 5 adds every other renderable element, but with a caution: except for input and other form-related elements, you must also assign a tabindex attribute to the IE 5 and later element (even if simply a value of zero for all) to let the accelerator key combination bring focus to the element.

Example
    <A href="http://www.megacorp.com/toc.html" accesskey="t">Table of Contents</A>
    		<H2 class="subsection" accesskey="2" tabindex="0">Part Two</H2>
Value
Single character of the document set.
Default
None.
Object Model Reference
    [window.]document.links[i].accessKey
    		[window.]document.anchors[i].accessKey
    		[window.]document.formName.elementName.accessKey
    		[window.]document.forms[i].elements[j].accessKey
    		[window.]document.getElementById(elementID).accessKey

cols | NN all IE all HTML all
cols="columnCount" | Optional
The width of the editable space of the textarea element. The value represents the number of monofont characters that are to be displayed within the width. For a browser that supports style sheet font sizes, the actual width changes accordingly.
Example
    <TEXTAREA cols="40">...</TEXTAREA>
Value
Any positive integer.
Default
Varies with browser and operating system.
Object Model Reference
    [window.]document.formName.elementName.cols
    [window.]document.forms[i].elements[j].cols
    [window.]document.getElementById(elementID).cols

datafld | NN n/a IE 4 HTML n/a
datafld="columnName" | Optional
Used with IE data binding to associate a remote data source column name with the content of the textarea element. A datasrc attribute must also be set for the element. Works only with text file data sources in IE 5/Mac.
Example
    <TEXTAREA name="summary" datasrc="DBSRC3" datafld="summary"></TEXTAREA>
Value
Case-sensitive identifier.
Default
None.
Object Model Reference
    [window.]document.formName.elementName.dataFld
    [window.]document.forms[i].elements[j].dataFld
    [window.]document.getElementById(elementID).dataFld

datasrc | NN n/a IE 4 HTML n/a
datasrc="dataSourceName" | Optional
Used with IE data binding to specify the ID of the page's object element that loads the data source object for remote data access. Content from the data source is specified via the datafld attribute. Works only with text file data sources in IE 5/Mac.
Example
    <TEXTAREA name="summary" datasrc="DBSRC3" datafld="summary"></TEXTAREA>
Value
Case-sensitive identifier.
Default
None.
Object Model Reference
    [window.]document.formName.elementName.dataSrc
    [window.]document.forms[i].elements[j].dataSrc
    [window.]document.getElementById(elementID).dataSrc

disabled | NN 6 IE 4 HTML 4
disabled | Optional
A disabled textarea element can't be activated by the user. In IE/Windows and Netscape 6, a disabled textarea cannot receive focus and doesn't become active within the tabbing order rotation. The name/value pair of a disabled element is not sent when the form is submitted.

The disabled attribute is a Boolean type, which means that its presence in the attribute sets its value to true. Its value can also be adjusted after the fact by scripting (see the textarea object in Chapter 9).

Example
    <TEXTAREA disabled></TEXTAREA>
Value
The presence of the attribute disables the element.
Default
false
Object Model Reference
    [window.]document.formName.elementName.disabled
    [window.]document.forms[i].elements[j].disabled
    [window.]document.getElementById(elementID).disabled

lang | NN 3 IE 4 HTML 4
lang="languageCode" | Optional
The language being used for the element's attribute values and content. A browser can use this information to assist in proper rendering of content with respect to details such as treatment of ligatures (when supported by a particular font or required by a written language), quotation marks, and hyphenation. Other applications and search engines might use this information to aid the selection of spell-checking dictionaries and the creation of indices.
Example
    <SPAN lang="de">Deutsche Bundesbahn</SPAN>
Value
Case-insensitive language code.
Default
Browser default.
Object Model Reference
    [window.]document.getElementById(elementID).lang

name | NN all IE all HTML all
name="elementIdentifier" | Optional
If the textarea element is part of a form being submitted to a server, the name attribute is required if the value of the element is to be submitted with the form. For forms that are in documents for the convenience of scripted form elements, textarea element names are not required but are helpful just the same in creating scripted references to these objects and their properties or methods. Newer DOMs encourage assigning the same identifier to the id attribute for uniform script references to the element object.
Example
    <TEXTAREA name="comments" id="comments"></TEXTAREA>
Value
Case-sensitive identifier.
Default
None.
Object Model Reference
    [window.]document.formName.elementName.name
    [window.]document.forms[i].elements[j].name
    [window.]document.getElementById(elementID).name

readonly | NN 6 IE 4 HTML 4
readonly | Optional
When the readonly attribute is present, the textarea element cannot be edited on the page by the user (although scripts can modify the content). A textarea marked as readonly should not receive focus within the tabbing order (although IE for the Macintosh allows the field to receive focus). Users can still select and copy text from a read-only textarea.
Example
    <TEXTAREA name="instructions" readonly></TEXTAREA>
Value
The presence of the attribute sets its value to true.
Default
false
Object Model Reference
    [window.]document.formName.elementName.readOnly
    [window.]document.forms[i].elements[j].readOnly
    [window.]document.getElementById(elementID).readOnly

rows | NN all IE all HTML all
rows="rowCount" | Optional
The height of the textarea element based on the number of lines of text that are to be displayed without scrolling. The value represents the number of monospace-font character lines that are to be displayed within the height before the scrollbar becomes active. For a browser that supports style sheet font sizes, the actual width changes accordingly.
Example
    <TEXTAREA rows="5" cols="40"></TEXTAREA>
Value
Any positive integer.
Default
Varies with browser and operating system.
Object Model Reference
    [window.]document.formName.elementName.rows
    [window.]document.forms[i].elements[j].rows
    [window.]document.getElementById(elementID).rows

style | NN 4 IE 4 HTML 4
style="styleSheetProperties" | Optional
This attribute lets you set one or more style sheet rule property assignments for the current element. You may use the CSS or (for Navigator 4 only) JavaScript syntax for assigning style attributes. Use the style attribute only with visible (renderable) elements.
Example
    <SPAN style="color:green; font-size:18px">Big, green, and bold</SPAN>
Value
An entire CSS-syntax style sheet rule is enclosed in quotes. Multiple style attribute settings are separated by semicolons. Style sheet attributes are detailed in Chapter 11.
Default
None.
Object Model Reference
    [window.]document.getElementById(elementID).style

tabindex | NN 6 IE 4 HTML 4
tabindex="integer" | Optional
A number that indicates the sequence of this element within the tabbing order of all focusable elements in the document. Tabbing order follows a strict set of rules. Elements that have values other than zero assigned to their tabindex attributes are first in line when a user starts tabbing in a page. Focus starts with the element with the lowest tabindex value and proceeds in order to the highest value, regardless of physical location on the page or in the document. If two elements have the same tabindex values, the element that comes earlier in the document receives focus first. Next come all elements that either don't support the tabindex attribute or have the value set to zero. These elements receive focus in the order in which they appear in the document. Note that reloading the current page does not necessarily restart the tabbing sequence from the "top." Therefore, controlling tabbing sequence is most helpful when the logic of your focusable elements is something other than the source code order of those elements (e.g., directing tabbing to fields down table columns rather than across rows).

HTML 4 and Netscape 6 limit the tabindex attribute to the following elements: a, area, button, input, object, select, textarea. To this list, IE 4 adds applet, body, div, embed, isindex, marquee, span, table, and td. IE 5 adds every other renderable element. A negative value in IE (only) removes an element from tabbing order entirely.

Links and anchors cannot be tabbed to with the Mac version of IE 4, so the tabindex for a elements is ignored in that version.

Example
    <A href="chapter3.html" tabindex="3">Chapter 3</A>
Value
Any integer from 0 through 32,767. In IE, setting tabindex to a negative value causes the element to be skipped in tabbing order altogether.
Default
None.
Object Model Reference
    [window.]document.getElementById(elementID).tabIndex

wrap | NN 2 IE 4 HTML n/a
wrap="wrapType" | Required
The wrap attribute tells the browser whether it should wrap text in a textarea element and whether wrapped text should be submitted to the server with soft returns converted to hard carriage returns. The HTML specification is silent on the subject, while Navigator and IE have, over the years, clouded the attribute values. But more recently, the mainstream browsers are coming together on a set of three attribute values: off, soft, and hard.

When set to soft, the text automatically wraps as the user types, but the carriage returns and line feeds (CRLFs) do not go with the text when the form is submitted. With a setting of hard, wrapping occurs, and the CRLFs introduced by wrapping become part of the textarea's value submitted to the server. Old synonyms for the soft value include virtual and physical. A setting of off means that typing beyond the right edge of the rectangle forces the textarea to scroll horizontally. Only a press of the Return key causes the text insertion pointer to advance to the next line.

Example
    <TEXTAREA name="comments" wrap="hard"></TEXTAREA>
Value
Constant values: hard | off | soft.
Default
soft
Object Model Reference
    [window.]document.formName.elementName.wrap
    [window.]document.forms[i].elements[j].wrap
    [window.]document.getElementById(elementID).wrap