- JavaScript Tutorial
- How to make pop-up windows
- JavaScript Object Reference (1)
- JavaScript Object Reference (2)
- JavaScript Object Reference (3)
- JavaScript Object Reference (4)
- JavaScript Object Reference (5)
- JavaScript Object Reference (6)
- JavaScript Functions and Operators
|
JavaScript Object Reference (6)
The textarea Object
The textarea object reflects a multi-line text field from an HTML form in JavaScript.
Properties
- defaultValue
- A string value containing the default value of the textarea element (i.e. the value of the VALUE attribute).
- name
- A string value containing the name of the textarea element.
- value
- A string value containing the value of the textarea element.
Methods
- focus()
- Emulates the action of focusing in the textarea field.
- blur()
- Emulates the action of removing focus from the textarea field.
- select()
- Emulates the action of selecting the text in the textarea field.
Event Handlers
- onBlur
- Specifies JavaScript code to execute when focus is removed from the field.
- onChange
- Specifies JavaScript code to execute when the content of the field is changed.
- onFocus
- Specifies JavaScript code to execute when focus is given to the field.
- onSelect
- Specifies JavaScript code to execute when the user selects some or all of the text in the field.
The window Object
The window object is the top-level object for each window or frame and is the parent object for the document, location and history objects.
Properties
- defaultStatus
- A string value containing the default value displayed in the status bar.
- frames
- An array of objects for each frame in a window. Frames appear in the array in the order in which they appear in the HTML source code.
- length
- An integer value indicating the number of frames in a parent window.
- name
- A string value containing the name of the window or frame.
- parent
- A string indicating the name of the window containing the frameset.
- self
- A alternative for the name of the current window.
- status
- Used to display a message in the status bar; this is done by assigning values to this property.
- top
- An alternative for the name of the top-most window.
- window
- An alternative for the name of the current window.
Methods
- alert(message)
- Displays message in a dialog box.
- close()
- Closes the window.
- confirm(message)
- Displays message in a dialog box with OK and CANCEL buttons. Returns true or false based on the button clicked by the user.
- open(url,name,features)
- Opens url in a window named name. If name doesn't exist, a new window is created with that name. features is an optional string argument containing a list of features for the new window. The feature list contains any of the following name-value pairs separated by commas and without additional spaces:
toolbar=[yes,no,1,0]
Indicates if the window should have a toolbar
location=[yes,no,1,0]
Indicates if the window should have a location field
directories=[yes,no,1,0]
Indicates if the window should have directory buttons
status=[yes,no,1,0]
Indicates if the window should have a status bar
menubar=[yes,no,1,0]
Indicates if the window should have menus
scrollbars=[yes,no,1,0]
Indicates if the window should have scroll bars
resizable=[yes,no,1,0]
Indicates if the window should be resizable
width=pixels
Indicates the width of the window in pixels
height=pixels
Indicates the height of the window in pixels
- prompt(message,response)
- Displays message in a dialog box with a text entry field with the default value of response. The user's response in the text entry field is returned as a string.
- setTimeout(expression,time)
- Evaluates expression after time where time is a value in milliseconds. The time-out can be named with the structure
name = setTimeOut(expression,time)
- clearTimeout(name)
- Cancels the time-out with the name name.
Event Handlers
- onLoad
- Specifies JavaScript code to execute when the window or frame finishes loading.
- onUnload
- Specifies JavaScript code to execute when the document in the window or frame is exited.
Previous | Contents | Next
|
|