Textarea

In Hypertext Markup Language (HTML), textarea is an HTML element that creates a text area on a Web page for user input (longer than a single line), using the <textarea> tag, as in the below HTML code example.

<form>
<textarea name="comments" id="comments" cols="20" rows="3"></textarea>
</form>

This would look like the example below, when displayed on a Web page.

The cols attribute controls the number of columns (width), while the rows attribute controls the number of rows (height). If you write any text within the <textarea></textarea> tags, it will display as the default text within the text area, as in the code/example below.

<form>
<textarea name="comments" id="comments" cols="50" rows="3">
Write your comments here...
</textarea>
</form>

This would display a box similar to the below example.

The name and id attributes are used to identify the textarea element for style sheets, accessibility, or scripting purposes.

Also see: HTML