Note: If you don't know what an element/tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.
Table of contents
Bypass table of contentsThe HTML textarea element inserts a multi-line text input in the document or form. Differently from the HTML input element, with the "type" attribute set to "text", this control can accept more than one line of text as input. This special feature, makes of this element a good choice when collecting comments or long messages.
This element is destined to collect information provided by the user. Once filled in, the content of this control can be submitted by the user and then received by a processing agent that will handle the data collected.
Note that the content of this element represents the control's initial value.
The "id" attribute assigns an identifier to the associated element. This identifier must be unique in the document and can be used to refer to that element in other instances (e.g., from client-side scripts).
The "class" attribute assigns a class name (or a list of class names separated by spaces) to the container element. It's used together with style sheets and tells the browser the class (or classes) to which the element is associated with.
A class gives presentational attributes to elements (read more at the Cascading Style Sheets tutorial).
This attribute is used to define presentational attributes for the containing element, and its value should be composed by style sheets properties. Although, in some cases, it can become useful, a better practice is to place presentational attributes in external files, relating them to elements with the "class" attribute. This way you keep the semantic and presentational parts of your document separated.
You can find more information about presentational attributes at the Cascading Style Sheets tutorial.
The purpose of this attribute is to provide a title for the element. Its value must be a short and accurate description of the element. Browsers usually render it as a "tool tip" when the user puts the mouse pointer over the element for a small period of time.
Specifies the language of an element's content. The default value in "unknown".
When writing XHTML 1.0 documents, the attribute used to specify the language of an elements is "xml:lang". For forward and backward compatibility both attributes can be used simultaneously like in the example below. Note, that in XHTML 1.1 the "lang" attribute has been completely replaced by "xml:lang" and its use is no longer valid.
This attribute indicates the direction in which the texts of the element must be read. This includes content, attribute values and tables. It has two possible values that are case-insensitive:
Assigns a name to the element, that will be used to identify it by the processing agent when the form is sent.
Sets the width of the textarea control as a number of characters. The real width is calculated using the average width of characters in the current font.
Sets the height of the textarea control as a number of text lines.
When this boolean attribute is present, users are unable to change the control's content. However, "readonly" controls can stil receive the focus and are sent with the form.
Remember that in XHTML, boolean attributes must take their own names as value (e.g., attr_name="attr_name").
Like with the "readonly" attribute, users are unable to change the control's content when this attribute is present. Besides, the control can't receive focus and its data isn't sent with the form.
Browsers usually render disabled controls as they're faded, with a set of gray colors.
Remember that in XHTML, boolean attributes must take their own names as value (e.g., attr_name="attr_name").
Specifies the position of this element in the tabbing order. The tabbing order defines a sequence with all the elements than can receive the focus. Users can navigate this sequence via keyboard (usually with the "tab" key).
Relates the element to a character key. Most browsers allow users to access the element by pressing that key while holding down the "alt" key. The activation result depends on the element's nature. For links, this action automatically follows the link, while other elements simply get the focus.
See a complete list and information about events in HTML
Diseño y desarrollo: Latitud29.com