TextArea Object
CSGNetwork FREE Source Code, Javascript Source, and Code Snippets!
CSGNetwork Custom Search
     Bookmark and Share
Top Free Apps

Right click this window and select "view source" in order to copy the source for this script.

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 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 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 Description
blur() Removes focus away from the textarea.
focus() Sets focus on the textarea.
select() Highlights the content of the textarea.

Bookmark and Share
Registered® Trademark™ and Copyright© 1973 - CSG, Computer Support Group, Inc. and CSGNetwork.Com All Rights Reserved