XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / textarea

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

textarea

HTML 4.01 | HTML 5

<textarea> ... </textarea>

Defines a multiline text input field. The content of the textarea element appears when the input field is first displayed.

Start/end tag

Required/required

Attributes

Core, Internationalization, events, focus, onselect, onchange, global HTML 5 attributes

  • autofocus (autofocus="autofocus" in XHTML)

    HTML 5 only. Specifies that the field should receive focus when the document loads. It is highlighted and ready for input.

  • cols="Zahl"

    Required. Defines the field’s visible width in characters. Users can enter longer lines, with content scrolling to the right or wrapping if the browser supports it.

  • disabled (disabled="disabled" in XHTML)

    Disables user input in the element. A script can change this. Browsers may display disabled controls differently, for example grayed out. This can help make parts of a form available only after certain information has been entered.

  • form="ID des übergeordneten Formulars"

    HTML 5 only. Explicitly associates the input element with a specific parent form. The input element need not be a child of the form element to which it belongs.

  • maxlength="Zahl"

    HTML 5 only. Specifies the maximum number of characters a user can enter.

  • name="Text"

    Required. Gives the input element a name, passed with its content to the processing application.

  • placeholder="Zahl"

    HTML 5 only. Contains a short hint or example, a word or short sentence, to help the user enter correct data. Longer descriptions should use the attribute title.

  • readonly (readonly="readonly" in XHTML)

    Specifies that the input element cannot be changed.

  • required (required="required" in XHTML)

    HTML 5 only. Specifies that input is required.

  • rows="Zahl"

    Required. Defines the field’s height in text lines. If the user enters more lines than are visible, the field scrolls to display them.

  • wrap="hard|soft"

    HTML 5 only. With the value hard line breaks entered in the field are sent to the processing application. In addition, when using hard, a cols attribute specifying the line length in characters is also required. With the default value soft any entered line breaks are not sent.

Example

<p>Wovon haben Sie letzte Nacht geträumt?</p>
<textarea name="dream" rows="4" cols="45">Erzählen Sie uns Ihren Traum in maximal 100 Wörtern.</textarea>

 

> back to the alphabetical list of elements

   

 

 

 

back to top