HTML Home
HTML Tags Reference
Selected Reading
© 2008 TutorialsPoint.COM
|
HTML <textarea> tag
Function:
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.
Difference between HTML and XHTML:
NONE
Example:
<form action="/cgi-bin/hello_get.cgi" method="get">
Description : <br />
<textarea rows="5" cols="50" name="description">
Enter description here...
</textarea>
<input type="submit" value="submit" />
</form>
|
This will produce following result:
Online Practice:
To Become more comfortable - Do Online Practice
Attributes:
| Attribute | Value | Description |
| cols | number | Specifies the width of the textarea based on the number of visible character widths. |
| disabled | disabled | Disables the input control. The button won't accept changes from the user. It also cannot receive focus and will be skipped when tabbing. |
| name | filed name | Assigns a name to the input control. |
| 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. |
| 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. |
Standard Attributes:
| Attribute | Description |
| class | Document wide identifier |
| dir | Specifies the direction of the text |
| id | Document wide identifier |
| title | Specifies a title to associate with the element. |
| style | Helps to include inline casecadubf style sheet. |
| lang | Sets the language code. |
| xml:lang | Sets the language code. |
| tabindex | Helps determine the tabbing order |
| accesskey | Access keys (or shortcut keys) |
Event Attributes:
| Attribute | Description |
| onfocus | Script runs when control gets focus |
| onblur | Script runs when control loses focus |
| onselect | Script runs when the element is selected |
| onchange | Script runs when the element changes |
| onclick | Script runs when a mouse click |
| ondblclick | Script runs when a mouse double-click |
| onmousedown | Script runs when mouse button is pressed |
| onmouseup | Script runs when mouse button is released |
| onmouseover | Script runs when mouse pointer moves over an element |
| onmousemove | Script runs when mouse pointer moves |
| onmouseout | Script runs when mouse pointer moves out of an element |
| onkeypress | Script runs when key is pressed and released |
| onkeydown | Script runs when key is pressed |
| onkeyup | Script runs when key is released |
|
|
|