textarea

The <textarea> element represents a multiline plain-text editor.

code result
<textarea cols="20" rows="10" id="description">
How i can describe banan? Oh very testy!
</textarea>


 






attributes

attribute description
id, name Name of element.
value Value for submission. It is a text between the <textarea> and </textarea> tags.
cols

Width of the text control in characters. Must be a positive integer. Default value is 20.

rows

Number of lines of the text control.

wrap

Possible values:

  • hard - the browser automatically inserts line breaks (CR+LF) so that each line has no more than the width of the control; the cols attribute must also be specified for this to take effect.
  • soft - the browser ensures that all line breaks in the value consist of a CR+LF pair, but does not insert any additional line breaks.
placeholder A example for the user of what can be entered in the control. It is must not be used as label. Use &#10; to insert new line character, not \n.
autocomplete

Possible values:

  • off - disallow to browser automatically complete
  • on - allow to browser automatically complete the value based on values that the user has entered during previous uses
spellcheck

A boolean value, specifies whether the <textarea> is subject to spell checking.

required

A boolean value, specifies that the user must fill in a value before submitting a form.

readonly

A boolean value, specifies that the user cannot modify the value of the control. Unlike the disabled attribute, the readonly attribute does not prevent the user from clicking or selecting in the control. The value of a read-only control is still submitted with the form.

form Id of associated <form> element.