Pr.Pg Next Pg

<TEXTAREA>..</TEXTAREA> tag tutorials

  • 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.

  • <TEXTAREA> tag has following attribute:

 

Sr No

Attributes

Descriptions

1

Cols

This attribute sets the width, in characters, of the text area. The typical default value for the size of a <textarea> tag when this attribute is not set is 20 characters.

2

Rows

This attribute sets the number of rows in the text area. The value of the attribute should be a positive integer.

3

Style

This attributes specifies the style of textarea and it’s contains.

4

Disabled

If present, make the control non-interactive and to prevent its value from being submitted.

5

Name

Unique name represents the element's name.

6

Placeholder

Sample value or a brief description of the expected the placeholder attribute should not be used as an alternative to a label.

7

Required

Specifies that a text area is required/must be filled out.

8

Wrap

Specifies how the text in a text area is to be wrapped when submitted in a form.

9

autofocus

This attribute is used to indicate that the user agent should immediately focus this form item once its containing window object (usually the document)is made active.

 

  • The HTML <textarea> tag is supported by all major browsers like, Chrome, Firefox, Internet Explorer, Safari, Opera etc.

 

Syntax:

<body>

<textarea attribute=value>

</textarea>

</body>

 

Example: HTML program to demonstrate textarea element

Output:
Pr.Pg border                                              Next Pg