TextArea Object
Textareas (<textarea></textarea>) within your form can be accessed, validated, and manipulated using
JavaScript, via the corresponding Textarea object. To access a textarea, use the
syntax:
document.myform.mytextarea //where myform and mytextarea
are the names of your form/element.
Events
Events |
Description |
onBlur |
Code is executed when the focus is
removed from the textarea. |
onChange |
Code is executed when the user changes
the value within the textarea, and removes focus away from the
field. |
onFocus |
Code is executed when the focus is set
on the textarea. |
onKeyDown |
Code is executed when user presses
down the key within the textarea. |
onKeyPress |
Code is executed when user presses the
key within the textarea. |
onKeyUp |
Code is executed when user releases a
key within the textarea. |
onSelect |
Code is executed when user selects
some text within the textarea. |
Properties
Properties |
Description |
accessKey |
String value that sets/ returns the accessKey for
the field. |
disabled |
Boolean value that sets/ returns whether the
field is disabled. |
form |
References the form that contains the
textarea. |
name |
Reflects the name of the textarea (the name attribute). |
type |
A property available on all form
elements, "type" returns the type of the calling form element, in
this case, "Textarea". |
value |
Read/write string that specifies the
value of the textarea. |
Methods
Methods |
Description |
blur() |
Removes focus away from the textarea. |
focus() |
Sets focus on the textarea. |
select() |
Highlights the content of the
textarea. |