JavaScript TextArea Object

The JavaScript TextArea Object is a property of the form object. Textarea syntax is:

<TEXTAREA NAME="" ROWS="10" COLS="40" onBlur="blurHandlerRouting">
Displayed Text
</TEXTAREA>

Here's how it looks:


The NAME, ROWS, and COLS values are required. Three optional handlers may be specified which are "onBlur", "onChange", and "onSelect". If these handlers are used, the appropriate function must exist to support the action.

Properties

  • defaultValue - The text string value that is initially displayed.
  • form - The form object that includes the textArea object.
  • name - The name of the textArea object. This object should always have a name.
  • type - The type of element which is textarea.
  • value - The value of the textArea object.
  • rows - The number of rows displayed in the text area.
  • cols - The number of columns displayed in the text area.
  • Wrap may be set to one of the following values:
    • OFF - Default, lines are not wrapped.
    • PHYSICAL - Wrap lines and place new line characters where the line wraps.
    • VIRTUAL - Wrap lines on the screen, but receive them as one line.

Methods

  • blur() - Takes the focus away from the textarea object.
  • focus() - Gives the focus to the textarea object.
  • select() - Selects the contents of the textarea.

Events

  • onBlur
  • onChange
  • onFocus
  • onSelect