textarea ElementThe textarea element is an inline element declared by the XHTML 1.1 Forms Module
Elements in the Forms Module are:form | label | textarea | select | optgroup | option | button | fieldset | legend | input type="button" | input type="checkbox" | input type="file" | input type="hidden" | input type="image" | input type="password" | input type="radio" | input type="reset" | input type="submit" | input type="text"
The textarea element is used within a
form to provide a text
box in which the user may enter a block of text. The width and height
of the textarea must be specified using
the compulsory cols
and rows
attributes respectively.
Any text enclosed within the
textarea element in the markup
is placed within the text box
when the form is first rendered. The user may then edit
the text (provided the textarea is not
disabled or
readonly)
and the final edited text is sent to
the processing URI as the value in a name=value pair.
Here is an example textarea:
<label for="msg">Your Message:</label><br />
<textarea cols="25" rows="6" id="msg" name="message">Enter your message here.</textarea>
This renders as:
See also the input type="text" element
for the input of shorter text.
The cols and rows attributes are #REQUIRED on the textarea element.
textarea element are listed below:accesskey [ type Character ]textarea element to allow text inputcols [ type Number - #REQUIRED ]textarea in characters (based on an average character width)disabled [ type Boolean ]textarea is initially disabled - no data is sent to the processing URI for disabled elements when the form is submitted. The user cannot interact with a disabled control.name [ type CDATA ]textarea when the form is submitted (if the name attribute is not present, the textarea data will not be sent). The value sent (in a name=value pair) is the text within the textarea at the time of submission (the initial value of the textarea - to which it is returned if the form is reset - is the content of the textarea element in the markup)readonly [ type Boolean ]textarea may not (initially) be modified by the user. Data may still be sent to the processing URI for readonly textareas.rows [ type Number - #REQUIRED ]textareatabindex [ type Number ]textarea in the tabbing order of the documentonblur [ type Script ]onchange [ type Script ]textarea has been changed (it is triggered only when the element loses focus and its content has changed since last gaining focus)onfocus [ type Script ]onselect [ type Script ]textarea is highlightedtextarea element are listed below:class [ type NMTOKENS ]id [ type ID ]style [ type CDATA ], from the Style Attribute Module (deprecated)title [ type Text ]xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]dir [ type Enumeration (ltr | rtl) ], from the Bi-directional Text Modulexml:lang [ type LanguageCode ]All attributes in the
Events Attribute Collection
are supported:onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
textarea element is:
See Content Model & Nesting for information about Content Model syntax and Nesting Groups.
textareatextareaabbr, acronym, address, cite, code, dfn, div, em, h1 - h6, kbd, p, q, samp, span, strong, varadd, dt, licaption, td, thfieldset, label, legendb, big, i, small, sub, sup, ttdel, insbdoobjectrb, rt