HTML Page Structure

HTML Elements
HTML Attributes


HTML Textarea Tag

HTML Textarea Tag is usefull when multiple lines input is requires. Whenever you like to take an input from the user which spans multiple lines, you use <textarea> tag. Unlimited text can be written in this area but you can fix the size of a text area by the cols and rows attributes. Remember that the textarea is not defined with an <input> tag.

You enter a <textarea> tag where you want start of the textarea and a closing </textarea> tag where you want end of the textarea.

cols attribute refers to the width of the textarea, rows attribute refers to the number of lines or height of the textarea, name attribute refers to the name of textarea readonly attribute refers to the read-only characteristics of the textarea and disabled attribute refers that the textarea should be disabled.

Syntax

<form>
	<textarea name="query"cols="30" rows="4"></textarea>
</form>

Example

<!DOCTYPE html>
<html>
<head>
<title>My HTML Textarea Tag Example</title>
</head>
<body>
<form>
      Post your query in the box given below:
      <p>
        <textarea name="query"cols="40" rows="8"></textarea>
     </p>
     <p>
        <input type=submit value="Submit">
      </p>
</form>
</body>
</html>

This will produce following result

Post your query in the box given below