Instances are created by the browser when it encounters an HTML
In the JavaScript object hierarchy, the Textarea object is located at window.document.Form.Textarea.
Event Handlers/Methods/Properties
Description
onBlur
Called when the text area loses the focus.
onChange
Called when the text area loses the focus and has had its value modified.
onFocus
Called when the text area receives the focus.
onKeyDown
Called when a key is pressed down. This occurs before an onKeyPress event handler is triggered.
onKeyPress
Called when a key is pressed down immediately after an onKeyDown event handler is triggered.
onKeyUp
Called when a key is released.
onSelect
Called when a user selects some of the text within the text area.
blur()
Removes the focus from the text area.
focus()
Gives the focus to the text area.
handleEvent()
Invokes the handler for the event specified.
select()
Selects the text in the text area.
defaultValue
Returns the value of this text area defined between the beginning and ending
form
Returns the entire form the text area is in.
name
Returns the name of this text area specified by the NAME attribute.
type
Returns the type of this text area. Note that this is always textarea.
value
Returns the value that is actually displayed in the text area.
<html> <head> <script language="JavaScript"> <!-- function openWin(){ var myInstance = document.myForm.myTextArea; var myWin = open("", "","width=450,height=200"); myWin.document.write("The defaultValue is: " + myInstance.defaultValue + "<br>"); myWin.document.write("The name is: " + myInstance.name + "<br>"); myWin.document.write("The type is: " + myInstance.type + "<br>"); myWin.document.write("The value is: " + myInstance.value + "<br>"); myWin.document.write(myInstance.form.myButton.value); myWin.document.close(); } --> </script> </head> <body> <form name="myForm"> <textarea name="myTextArea" rows=6 cols=50> Here is some text in my text area. </textarea> <input type=BUTTON value="Click to Process" name="myButton" onClick="openWin()"> </form> </body> </html>