JAVASCRIPT CODE ------------------------------------------------------------------------------- Syntax WINDOW ------------------------------------------------------------------------------- frames[] Array of child frames frames.length Number of defined child frames self The current window status Display message at bottom of document opener The window name of the calling window parent The parent window top Top most window alert("message") Displays JavaScript Alert dialog box blur() Removes focus from current window close() Closes new window confirm("message") Displays a Confirm dialog box focus() Brings focus to current window prompt("message") Displays a prompt dialog box scroll(x,y) Scrolls current window to pixel coordinates (x,y) open("URL," "windowname" "feature1, feature2, feature3, etc.") Opens a new window with specified name and feature - toolbar=yes or no Determine whether to include Back, Forward, Home - location=yes or no Determine whether to show current URL location - directories=yes or no Determine to show other buttons - status=yes or no Determine to display status bar or not - menubar=yes or no Determine to display menu bar or not - scrollbars=yes or no Determine to create scroll bars or not - resizable=yes or no Determine whether user may resize the window - copyhistory=yes or no Determine whether new window contain current info - width = # pixels Defines how wide the window should be - height= # pixels Defines how tall the window should be LOCATION ------------------------------------------------------------------------------- current Contains the value of the current URL href The entire URL as JavaScript string protocol A string consisting first part of the URL host A string consisting of the hostname of the URL hostname A string consisting of the hostname of the URL port A string consisting of the port from the URL pathname A string consisting everthing after third slash hash A string consisting of any text after the # search A string consisting of any text after the ? length Contains the current length of history list back() Moves user to the URL of the back page forward() Moves user to the URL of the forward page go() Moves user to the desire URL DOCUMENT ------------------------------------------------------------------------------- title Current document title location Full URL of the document lastModified A date object string of document was last modified referrer Contains the URL of the calling document bgColor Background color fgColor Foreground (text) color linkColor Hyperlink color vlinkColor Visited hyperlink color alinkColor Activated hyperlink color forms[] Array of forms objects in the document forms.length The number of form objects within the document links[] Array objects corresponding to all HREF links links.length The number of HREF links in the document anchors[] Array of all "named" anchors within the document anchors.length The number of named anchors in the document images[] Image objects that correspond to each image applets[] Java applets that correspond to each applet embeds[] Plugins objects that represent each plug-in write("string") Write strings to the current window writeln("string") Perform same as write(), but adds a carriage clear() Clears the window close() Closes the window FORM ------------------------------------------------------------------------------- name String value of the "name" attribute of
method Numeric value of the "method" attribute of action String value of the "action" attribute of target Window targeted for form response ater submitted elements[index] Object that contains object of each element length Contains the number of elements in the form submit() Submits the form reset() Resets the form onSubmit() Identifies code to run when the form is submitted onReset() Identifies code to run when the form is reset TEXT and TEXTAREA ------------------------------------------------------------------------------- name String value of the name attribute value String value of the contents in the field defaultValue String value of the initial contents of the field type Specifies what type of object this form field is focus() Sets input focus to the object blur() Removes input focus from the object select() Selects the object's input field onFocus Executes when input focus enters field onBlur Executes when input focus leaves the field onSelect Executes when the field is input-focus onChange Executes when input focus exits field with change CHECKBOX ------------------------------------------------------------------------------- name String value of the "name" attribute value String value of the contents of the checkbox checked Boolean value that reflects the "checked" attrib defaultChecked Same as checked but defaulted type Specifies what type of object the form field is click() Selects the checkbox, causing it to be "on" onClick Excecutes when the user checks or unckecks box RADIO ------------------------------------------------------------------------------- name String value of the "name" attribute length The number of radio buttons in the radio object value String value of the "value" attribute checked Boolean value. True if pressed; false if not defaultChecked Boolean property that reflects the "checked" attrib type Specifies what type of object this form field is click() Selects the radio button onClick Executes when the radio button is selected SELECT ------------------------------------------------------------------------------- length Contains the number of objects in the select object name The internal name of the select object by "name" selectedIndex The index number of currently selected option type Specifies what type of object this form field is options[] Property is an object reflecting