windowName specifies a name for the window object being opened.
windowFeatures is a comma-separated list of any of the following options and values:
toolbar[=yes|no]|[=1|0]
location[=yes|no]|[=1|0]
directories[=yes|no]|[=1|0]
status[=yes|no]|[=1|0]
menubar[=yes|no]|[=1|0]
scrollbars[=yes|no]|[=1|0]
resizable[=yes|no]|[=1|0]
copyhistory[=yes|no]|[=1|0]
width=pixels
height=pixels
You may use any subset of these options. Separate options with a comma.
Do not put spaces between the options.
pixels is a positive integer specifying the dimension in pixels.
NOTE:
In event handlers, you must specify window.open() unless you want to call document.open()
because of the scoping of static objects in JavaScript.
Description for window
The open method opens a new web browser window on the client, similar to choosing File|New Web Browser from the menu of the Navigator. The URL argument specifies the URL contained by the new window. If URL is an empty string, a new, empty window is created.
windowFeatures is an optional, comma-separated list of options for the new window. The boolean windowFeatures options are set to true if they are specified without values, or as yes or 1. For example, open("", "messageWindow", "toolbar") and open("", "messageWindow", "toolbar=1") both set the toolbar option to true. If windowName does not specify an existing window and you do not specify windowFeatures, all boolean windowFeatures are true by default.
Following is a description of the windowFeatures:
toolbar creates the standard Navigator toolbar, with buttons such as "Back" and "Forward", if true
location creates a Location entry field, if true
directories creates the standard Navigator directory buttons, such as "What's New" and "What's Cool", if true
status creates the status bar at the bottom of the window, if true
menubar creates the menu at the top of the window, if true
scrollbars creates horizontal and vertical scrollbars when the document grows larger than the window dimensions, if true
resizable allows a user to resize the window, if true
copyhistory gives the new window the same session history as the current window, if true
width specifies the width of the window in pixels
height specifies the height of the window in pixels
Description for document
Description to be supplied.
Applies to
document, window
Examples
In the following example, the windowOpener function opens a window and uses write methods to display a message:
Returns its argument, rounded to the nearest integer. In other words, if its argument is n.5 or greater (where n is an integer), returns n+1, otherwise returns n.
For password, text, and textArea, selects the input area of the object.
Syntax
select()
Description
Use the select method to highlight the input area of a form element. You can use the select method with the focus method to highlight a field and position the cursor for a user response.
Applies to
password, text, textArea
Examples
In the following example, the checkPassword function confirms that a user has entered a valid password. If the password is not valid, the select method highlights the password field and focus method returns focus to it so the user can re-enter the password.
function checkPassword(userPass) {
if (badPassword) {
alert("Please enter your password again.")
userPass.focus()
userPass.select()
}
}
This example assumes that the password is defined as: