# How do we display a text area in HTML?

HTMLFront End TechnologyWeb Development

#### Kickstart HTML, CSS and PHP: Build a Responsive Website

Featured

59 Lectures 8.5 hours

#### Web Design for Beginners: Build Websites in HTML & CSS 2022

68 Lectures 8 hours

#### Complete HTML/CSS Course 2022

Featured

47 Lectures 12.5 hours

Use the <textarea> tag to show a text area. The HTML <textarea> tag is used within a form to declare a textarea element - a control that allows the user to input text over multiple rows.

The following are the attributes −

Attribute
Value
Description
autofocus
Autofocus
Specifies that on page load the text area should automatically get focus.
cols
Number
Specifies the width of the textarea based on the number of visible character widths.
disabled
Disabled
Specifies the width of the textarea based on the number of visible character widths.
form
form_id
Specifies one or more forms.
maxlength
Number
Specifies the maximum number of characters in textarea.
name
Text
Assigns a name to the input control.
placeholder
Text
Specifies a short hint of the value in textarea.
Sets the input control to read-only. It won't allow the user to change the value. The control, however, can receive focus and are included when tabbing through the form controls.
required
Required
Specifies that a textarea is required.
rows
Number
Specifies the height of the textarea based on the number of visible lines of text. If there's more text than this allows, users can scroll using the textarea's scrollbars.
wrap
hard
soft
Specifies the text to be wrapped in textarea.

## Example

You can try to run the following code to display a text area in HTML −

<!DOCTYPE html>
<html>
<title>HTML textarea Tag</title>
<body>
<form action = "/cgi-bin/hello_get.cgi" method = "get">
Enter subjects
<br />

<textarea rows = "5" cols = "50" name = "description">
</textarea>

<input type = "submit" value = "submit" />
</form>
</body>
</html>
Updated on 02-Mar-2020 12:13:58