
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to Create a Multi-line Text Input (Text Area) In HTML?
To create a multi-line text input, use the HTML <textarea> tag. You can set the size of a text area using the cols and rows attributes. It is used within a form, to allow users to input text over multiple rows.
Here are the attributes of <textarea> tag −
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. |
Readonly | readonly | 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 create a multi-line text input in HTML −
<!DOCTYPE html> <html> <head> <title>HTML textarea Tag</title> </head> <body> <form action = "/cgi-bin/hello_get.cgi" method = "get"> What improvements you want in College? <br> <textarea rows = "5" cols = "60" name = "description"> Enter details here... </textarea><br> <input type = "submit" value = "submit" /> </form> </body> </html>
- Related Articles
- How to use a textarea (a multi-line text input field) in HTML?
- How to create a multiline input control text area in HTML5
- How to create a text area in JavaFX?
- How to disable spell check from input box and text area in HTML forms?
- How to create teletype text in HTML?
- How to create a text input box with Pygame?
- HTML DOM Input Text object
- How do we display a text area in HTML?
- Create small text in HTML
- Create strong text in HTML
- Create superscripted text in HTML
- HTML DOM Input Text autocomplete Property
- HTML DOM Input Text autofocus Property
- HTML DOM Input Text defaultValue Property
- HTML DOM Input Text disabled Property

Advertisements