25.280. Textarea: a multiline text input areaDOM Level 2 HTML: Node |
Property | Attribute | Description |
---|---|---|
String accessKey | accesskey | Keyboard shortcut character |
long cols | cols | The width in character columns |
boolean disabled | disabled | Whether the Textarea is disabled |
String name | name | Textarea name for form submission and element access. |
boolean readOnly | readonly | Whether the Textarea is noneditable |
long rows | rows | Height of Textarea in lines |
long tabIndex | tabindex | Position of Textarea in tabbing order |
blur( )
Takes keyboard focus away from this element.
focus( )
Transfers keyboard focus to this element.
select( )
Selects the entire contents of the text area.
onchange
Invoked when the user edits the text displayed in this element and then moves the keyboard focus elsewhere. This event handler is not invoked for every keystroke in the Textarea element but only when the user completes an edit.
A Textarea is created with standard HTML <textarea> and </textarea> tags:
<form> ... <textarea [ name="name" ] // A name that can be used to refer to this element [ rows="integer" ] // How many lines tall the element is [ cols="integer" ] // How many characters wide the element is [ onchange="handler" ] // The onchange( ) event handler > plain_text // The initial text; specifies defaultValue </textarea> ...</form>
A Textarea object represents an HTML <textarea> element that creates a multiline text input field (usually within an HTML form). The initial contents of the text area are specified between the <textarea> and </textarea> tags. You can query and set the text with the value property.
Textarea is a form input element like Input and Select. Like those objects, it defines form, name, and type properties.
Form, Input; Chapter 18