HTML textarea Tag

HTML textarea Tag and JavaScript

Attributes - option w3.org

Attribute Value Description
autofocus autofocus Allows the author to indicate that a control is to be focused as soon as the page is loaded
cols number specifies the expected maximum number of characters per line. by defult, it is 20.
disabled disabled If present, make the control non-interactive and to prevent its value from being submitted.
form form_id Associate the textarea element with its form owner.
maxlength number Specifies the maximum number of characters allowed in the text area
name text Represents the element's name.
placeholder text Represents a hint (a word or short phrase) intended to aid the user with data entry.
The placeholder attribute should not be used as an alternative to a label.
readonly readonly Control whether the text can be edited by the user or not.
required required When specified, the user will be required to enter a value before submitting the form.
rows number Specifies the number of lines to show. by defult, it is 2.
wrap soft/ hard

soft
The Soft state indicates that the text in the textarea is not to be wrapped when it is submitted (though it can still be wrapped in the rendering).

hard
The Hard state indicates that the text in the textarea is to have newlines added by the user agent so that the text is wrapped when it is submitted.
If the element's wrap attribute is in the Hard state, the cols attribute must be specified.

 

<p>If you have any comments, please let us know: 
<textarea cols="80" name="comments"></textarea></p>