The <textarea> tag is used to insert a multi-heritage(multiline) text input in the document or form in a webpage.Differently from the HTML input tag, as soon as the "type" attribute set to "text", this control can espouse to on peak of one descent of text as input. This feature, makes of this tag a best assuage on recieving comments or long messages.It is an HTML5 tag.It has opening and closing tags.
The <textarea> tag is destined to mass recommendation provided by the devotee. Once filled in, the content of this run can be submitted by the enthusiast and later recognized by a meting out agent that will handle the data collected. The content of <textarea> tag represents the manage's initial value. A text place can maintain an alter number of characters, and the text renders in a unadulterated-width font.

Optional Attributes for <textarea> tag :- autofocus|cols|disabled|formmaxlength | name | placeholder | readonly | required | rows | wrap



You can understand use of <textarea> tag by a simple example:-

e.g.1

<!DOCTYPE html>
<html>
<head>
<title>use of textarea tag</title>
</head>
<body>
<form action="xyzscript.php" /> <p>Message:-</p> <div><textarea name="address"cols="60" rows="5"></textarea></div> <div><input type="submit" /></div> </form> </body> </html>


Result:-

Message:-


If you want to merge header then use colspan attribute.Just like we use in above example.

e.g.2

The size of a text area can be set by the cols and rows attributes or you can use css 'height' and 'width' properties.Attribute row is used to define the number of viewable rows. while cols is used to define the number of viewable columns.

<!DOCTYPE html>
<html>
<head>
<title>use of textarea tag</title>
</head>
<body>
<textarea rows="5" cols="60"> www.indianwebschool.com is india's leading web programming portal. </textarea> </body>
</html>


Result:-



<textarea> Tag Attributes


Attribute Value Description
autofocus autofocus Specifies that a text place should automatically acquire focus once the page loads
cols number Specifies the visible width of a text place
disabled disabled Specifies that a text place should be disabled
form form_id Specifies one or more forms the text place belongs to
maxlength number Specifies the maximum number of characters allowed in the text place
name text Specifies a name for a text place
placeholder text Specifies a quick hint that describes the declared value of a text place
readonly readonly Specifies that a text place should be read-only
required required Specifies that a text place is required/must be filled out
rows number Specifies the visible number of lines in a text place
wrap hard
soft
Specifies how the text in a text place is to be wrapped following submitted in a form


Conclusion:--

So the <textarea> tag to add a multi-heritage(multiline) text input in the document in a webpage.The <textarea> tag is destined to mass come taking place in the middle of the keep for advice provided by the adherent. Once filled in, the content of this run can be submitted by the adherent and fused ascribed by a dispensation agent that will handle the data collected.



0 comments:

Post a Comment