asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Elements > TEXTAREA Element

<TEXTAREA Element | TEXTAREA Object


Specifies a scrollable text box.HTML 2, 3.2, 4, 4.01, 5

HTML Syntax

Remarks

The TEXTAREA element defines a multiline text input control wherein users can enter one or more lines of text.

The number of lines and the number of characters per line, that the TEXTAREA can accommodate without scrolling, can be specified with the rows and cols attribute. The wrap attribute specifies how text wrapping is handled by the element.

Scrollbars appear in the TEXTAREA if the text exceeds the number of specified rows or columns. The CSS overflow attribute, however, can be used to control scrollbar behavior.

TEXTAREA defaults to a fixed-pitch font, though CSS font styles may be applied with the style attribute.

NOTE: Both start and end tags are required.

Attributes

The <textarea> element supports the following attributes, in addition to global attributes common to all HTML elements.

AttributeValueDescription
autofocusautofocusSpecifies that a text area should automatically get focus when the page loads
colsnumberSpecifies the visible width of a text area
dirnametextareaname.dirSpecifies that the text direction of the textarea will be submitted
disableddisabledSpecifies that a text area should be disabled
formform_idSpecifies which form the text area belongs to
maxlengthnumberSpecifies the maximum number of characters allowed in the text area
nametextSpecifies a name for a text area
placeholdertextSpecifies a short hint that describes the expected value of a text area
readonlyreadonlySpecifies that a text area should be read-only
requiredrequiredSpecifies that a text area is required/must be filled out
rowsnumberSpecifies the visible number of lines in a text area
wraphard, softSpecifies how the text in a text area is to be wrapped when submitted in a form

Example

The following shows how the textarea element may be used.

<textarea cols="40" rows="5">TEXTAREA automatically  provides scrollbars
to accommodate varying amounts of text ... </textarea>

See Also

INPUT



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note