HTML <textarea> tag

You are Here:

HTML <textarea> tag

The <textarea> tag defines a multi-line plain-text editing control.

The <textarea> tag is used when you want to allow users to enter a sizeable amount of text. For example, to receive feedbacks, comments, edits, questions etc.

By default, text in a <textarea> is rendered in a monospace or fixed-width font.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <textarea cols="30" rows="4"> Tell us about yourself... </textarea> </body> </html>

Attributes

The following are the attributes of <textarea> tag. Also try Global attributes.

AttributeValueExplanation
autocomplete
  • on
  • off
Specifies whether the value of the <textarea> element can be automatically completed by the browser.
autofocus-Specifies that a textarea should automatically get focus when the page loads.
colsnumberSpecifies the width of a textarea.
dirnamemyName.dirSpecifies that the text direction of the textarea will be submitted
disabled-Specifies that a textarea should be disabled.
formform_idSpecifies that one or more textarea outside the forms tag belongs to it.
maxlengthnumberSpecifies the maximum number of characters allowed in the textarea (including space and new line).
minlengthnumberSpecifies the minimum number of characters required in the textarea (including space and new line).
nametextSpecifies a name for a textarea.
placeholdertextSpecifies a short description about what this textarea is for.
readonly-Specifies that the user cannot modify the value in the textarea.
required-Specifies that the user must fill in a value in the textarea before submitting a form.
rowsnumberSpecifies the number of lines in a textarea.
spellcheck-Specifies automatic spelling check.
wrap
  • hard
  • soft
  • off
Specifies how to wrap the text in a textarea, when a form is submitted.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author