Share on Google+Share on Google+

HTML5 textarea tag, Example of <textarea> tag in html5

Here, We will introduce you about the <textarea> tag in html5.

HTML5 textarea tag, Example of <textarea> tag in html5

Here, We will introduce you about the <textarea> tag in html5. This tag is used for defining the control that allows multi line text input from user. The <textarea> tag is generally used within the <form> tag. The size of the text  input area is set by using attribute cols and rows. 

Declaration Syntax:

<textarea> Predefined text Here</textarea>

This tag have following specific attribute are as:

Attribute Name Vsalue Description
name "string" or "empty string" Name of the textarea used to submit the value.
autofocus "autofocus" or      "empty string" The focus is given to the control automatically when page loads.
disabled "disabled" or "empty string" If present, the control is disabled and can not accept changes from user.
form form name The name of the form from which the tag is associated.
readonly "readonly" or       "empty string" Specify that the control is read only and can not be edit by user.
maxlength non negative number Maximum allowed number of character in element.
required "required" or     "empty string" Specifies that the text area value must be needed to form submission.
placeholder "string" Specify the help comment to user related to the textarea input.
rows "number" It specify the number of lines in textarea for showing to the user.
cols "number" It specify the number of  character per line in textarea for showing to the user.
wrap "soft"


Specify the user to add no line break, soft is default value.

specify the user to insert line break in such way that the no line have character greater than cols attribute.

Example: textarea_tag.html.

<!DOCTYPE html>
      <title>Example of textarea Tag</title>
   <body>The textarea here.<br>
   <form action="html5_textarea_tag.html">
        <textarea rows="5" cols="30">
    This is the sample text area.
    <input type="submit" value="submit"/>


Download This Example:

Difference between html4.01 and html5.

The attributes like cols, rows, name are also supported by html4.1 and remaining are new in html5.


Posted on: September 17, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null