Name

textarea — HTML 4.01 | HTML5

Synopsis

<textarea> . . . </textarea>

Defines a multiline text entry control. The content of the textarea element is displayed in the text entry field when the form initially displays.

Start/End Tags

Required/Required

Attributes

Core, Internationalization, Events, Focus, onselect, onchange, HTML5 Global Attributes

autofocus (autofocus="autofocus" in XHTML)

HTML5 only. Indicates the control should have focus (be highlighted and ready for user input) when the document loads.

cols="number"

Required. Specifies the visible width of the text entry field, measured in number of characters. Users may enter text lines that are longer than the provided width, in which case the entry scrolls to the right (or wraps if the browser provides some mechanism for doing so).

disabled (disabled="disabled" in XHTML)

Disables the control for user input. It can be altered only via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.

form="id of form owner"

HTML5 only. Explicitly associates the input control with its associated form (its form owner). With this method, the input control does not need to be a child of the form element that applies to it.

maxlength="number"

HTML5 only. Specifies the maximum number of characters the user can input for a text or password input element.

name="text"

Required. Specifies a name for the text input control. This name will be sent along ...

Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.