Capturing Multiple Lines of Text
Description
The textarea element creates a multiline text box.
It has local Attributes:name, disabled, form, readonly, maxlength, autofocus, required, placeholder, dirname, rows, wrap, cols.
The text contents are wrapped between the start and end tags.
The form, autofocus, required, placeholder, and wrap attributes are new in HTML5.
The rows and cols attributes specify the dimensions of the textarea.
The hard or soft value for wrap attribute control how line breaks are added to the text.
Example
The following code shows the textarea element in use.
<!DOCTYPE HTML>
<html>
<body>
<form method="post" action="http://example.com/form">
<p>
<textarea cols="20" rows="5" wrap="hard" id="story" name="story">
Say something<!--from www . j av a2 s. co m-->
</textarea>
<input type="submit" value="Submit" />
</p>
</form>
</body>
</html>
The wrap attribute controls how line breaks are inserted into the text when the form is submitted.