Name
Textarea — a multiline text input area
Availability
JavaScript 1.0; enhanced in JavaScript 1.1
Inherits from/Overrides
Inherits from Input, HTMLElement
Synopsis
form.nameform.elements[i]
Properties
Textarea inherits the properties of Input and HTMLElement and defines or overrides the following:
-
value A read/write string property. The initial value of this property is the same as the
defaultValueproperty: the plain text (i.e., without any HTML tags) that appears between the<textarea>and</textarea>tags. When the user types characters into the Textarea object, thevalueproperty is updated to match the user’s input. If you set thevalueproperty explicitly, the string you specify is displayed in the Textarea object. Thisvalueproperty contains the string that is sent to the server when the form is submitted.
Methods
Textarea inherits the methods of Input and HTMLElement.
Event Handlers
Textarea inherits the event handlers of Input and HTMLElement and defines or overrides the following:
-
onchange Invoked when the user changes the value in the Textarea element and 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.
HTML Syntax
A Textarea element 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" ] // ...