Name
Textarea
Synopsis
form.elements[i]form.elements[name]form.name
Description
The Textarea object is very similar to the Input object.
Properties
The Textarea object defines properties for each of the
attributes of the HTML <textarea> tag, such as cols, defaultValue, disabled, name, readOnly, and rows. It also defines the following
properties:
formThe Form object that contains this Textarea object. Read-only.
typeA read-only string property that specifies the type of the element. For Textarea objects, this is always “textarea”.
valueA read/write string that specifies the text contained in the Textarea. The initial value of this property is the same as the
defaultValueproperty.
Methods
blur( )Yields the keyboard focus and returns nothing.
focus( )Grabs the keyboard focus and returns nothing.
select( )Selects the entire contents of the text area. Returns nothing.
Event Handlers
onblurInvoked when input focus is lost.
onchangeInvoked when the user changes the value in the Textarea element and moves the keyboard focus elsewhere. This event handler is invoked only when the user completes an edit in the Textarea element.
onfocusInvoked when input focus is gained.
See Also
Element, Form, Input
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access