Breaking

Sunday, May 12, 2019

HTML textarea Tag

Definition and Usage

The <textarea> tag defines a multi-line text input control.
A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).
The size of a text area can be specified by the cols and rows attributes, or even better; through CSS' height and width properties.

Browser Support

Element
<textarea>YesYesYesYesYes

Differences Between HTML 4.01 and HTML5

HTML5 has added several new attributes.


Attributes

= New in HTML5.
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 one or more forms 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
soft
Specifies how the text in a text area is to be wrapped when submitted in a form

Global Attributes

The <textarea> tag also supports the Global Attributes in HTML.

Event Attributes

The <textarea> tag also supports the Event Attributes in HTML.

Related Pages

HTML DOM reference: Textarea Object
CSS Tutorial: Styling Forms

Default CSS Settings

None

No comments:

Post a Comment