Skip to Content
JavaScript: The Definitive Guide, Fourth Edition
book

JavaScript: The Definitive Guide, Fourth Edition

by David Flanagan
November 2001
Intermediate to advanced
936 pages
68h 43m
English
O'Reilly Media, Inc.
Content preview from JavaScript: The Definitive Guide, Fourth Edition

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.name
                  form.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 defaultValue property: 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, the value property is updated to match the user’s input. If you set the value property explicitly, the string you specify is displayed in the Textarea object. This value property 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" ] // ...
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.
Start your free trial

You might also like

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

John Pollock
JavaScript Cookbook, 3rd Edition

JavaScript Cookbook, 3rd Edition

Adam D. Scott, Matthew MacDonald, Shelley Powers

Publisher Resources

ISBN: 0596000480Supplemental ContentCatalog PageErrata