
Returns the current state of the command.
Boolean = object.queryCommandState(command)
Parameter Description command (String) String that specifies the command to query. Can be any valid command identifier.
Returns TRUE if the given command has been carried out on the object, FALSE if it has not, and NULL if it is not possible to determine the command state.
execCommand, queryCommandEnabled, queryCommandIndeterm, queryCommandSupported, queryCommandValue
Returns whether the current command is supported on the current range.
Boolean = object.queryCommandSupported(command)
Parameter Description command (String) String that specifies the command to query. Can be any valid command identifier.
Returns TRUE if the command is supported, or FALSE otherwise.
execCommand, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandValue
Returns the current value of the given command. If the command returns a value such as a color rather than a TRUE/FALSE state, this command is used to retrieve the current value of the document or range.
string = object.queryCommandValue(command)
Parameter Description command (String) String that specifies the command to query. Can be any valid command identifier.
Returns a string representing the command value if the command is supported, or TRUE/FALSE.
execCommand, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported
Refreshes the content of the table.
object.refresh( )
No return value.
Reloads the current page.
object.reload( )
No return value.
Removes an element from the collection.
object.remove(index)
Parameter Description index Number or string specifying the element to remove. If this parameter is a number, the method removes the element at the given position in the collection, where 0 is the first position, 1 the second, and so on. If this parameter is a string, the method removes all elements having a name or id property equal to the string.
No return value.
For the areas object, this method can only be used on the object after the page has been loaded. If the method is applied "inline," a run-time error will occur.
Removes the given attribute from the element.
Boolean = object.removeAttribute(attrName [, caseSensitive])
Parameter Description attrName String specifying the name of the attribute. caseSensitive Optional. Boolean value specifying whether to use a case-sensitive search to locate the attribute. If TRUE, the uppercase and lowercase letters in attrName must match exactly those in the attribute name. By default, this parameter is TRUE. If there are multiple attributes specified with different case sensitivity, the attribute returned might vary across platforms.
Returns TRUE if successful, or FALSE otherwise.
If two or more attributes have the same name (differing only in uppercase and lowercase letters) and caseSensitive is FALSE, this method removes only the last attribute (the last to be created with this name). All other attributes of the same name are ignored.
A, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IFRAME, IMG, INPUT, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, META, NEXTID, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, WBR, XMP, style
Replaces the current document by loading the document at the given url. This method also removes the current document from the browser's session history.
object.replace(url)
Parameter Description url String specifying the URL to insert into the session history.
Replacing a document causes it to no longer be accessible through the history object. Also, the URL is no longer accessible through the user interface navigation methods (Back, Forward, and so on).
Simulates a mouse click on a reset button for the calling form.
object.reset( )
No return value.
Changes the size of the window outside dimensions by the specified x and y offset relative to its current size.
object.resizeBy(x, y)
Parameter Description x (Long) Horizontal scroll offset, in pixels. y (Long) Vertical scroll offset, in pixels.
No return value.
Sets the size of the window outside dimensions to the specified x and y pixel sizes.
object.resizeTo(x, y)
Parameter Description x (Long) Horizontal scroll offset, in pixels. y (Long) Vertical scroll offset, in pixels.
No return value.
Causes the window to scroll to the specified x and y offset at the upper-left corner of the window. The preferred method for this is scrollTo; the scroll method is provided for backward compatibility only.
object.scroll(x, y)
Parameter Description x (Long) Horizontal position, in pixels. y (Long) Vertical offset, in pixels.
No return value.
Causes the window to scroll relative to the current scrolled position by the specified x and y pixel offsets.
object.scrollBy(x, y)
Parameter Description x (Long) Horizontal scroll offset, in pixels. y (Long) Vertical scroll offset, in pixels.
No return value.
Positive values of x/y scroll further right/down; negative values scroll further left/up. Setting the scroll position beyond the limits results in the extreme valid scroll position in the direction specified.
Causes the object to scroll into view, aligning it at either the top or bottom of the window.
object.scrollIntoView([start])
Parameter Description start Optional. Boolean value specifying whether to place the object at the top of the window or at the bottom. If TRUE, the method causes the object to scrolls so that its top is visible at the top of the window. If FALSE, the bottom of the object is visible at the bottom of the window. If no value is given, the object scrolls to the top by default.
No return value.
The following example causes the element to scroll into view within the window, placing it at either the top or bottom of the window. The method is useful for immediately showing the user the result of some action without requiring the user to manually scroll through the document to find the result. This example underlines the content of the fifth paragraph and scrolls it into view at the top of the window.
var coll = document.all.tags("P"); if (coll.length>=5) { coll(4).style.textDecoration = "underline"; coll(4).scrollIntoView(true); }Depending on the size of the given object and the current window, this method might not be able to put the item at the very top or very bottom, but will always position the object as close to the requested position as possible.
A, ADDRESS, APPLET, AREA, B, BIG, BLOCKQUOTE, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IFRAME, IMG, INPUT, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, P, PLAINTEXT, PRE, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, WBR, XMP, TextRange
Scrolls the window to the specified x and y offsets at the upper-left corner of the window.
object.scrollTo(x, y)
Parameter Description x (Long) Horizontal scroll offset, in pixels. y (Long) Vertical scroll offset, in pixels.
No return value.
Highlights the input area of a form element.
object.select( )
No return value.
You can use the select method with the focus method to highlight a field and position the cursor for a user response.
Makes the active selection equal to the current object.
object.select( )
No return value.
This feature might not be available on non-Win32 platforms. See article Q172976 in the Microsoft Knowledge Base for the latest information on Internet Explorer cross-platform compatibility.
Sets the value of the given attribute. If the attribute is not already present, the method adds the attribute to the element and sets the value.
object.setAttribute(attrName , value [, caseSensitive])
Parameter Description attrName String specifying the name of the attribute. value String, number, or Boolean value to assign to the attribute. caseSensitive Optional. Boolean value specifying whether to use a case-sensitive search to locate the attribute. If TRUE, the uppercase and lowercase letters in attrName must match exactly those in the attribute name. By default, this parameter is TRUE.
No return value.
Be careful when spelling attribute names. If caseSensitive is TRUE and attrName does not have the same uppercase and lowercase letters as the attribute, this method creates a new attribute.
If two or more attributes have the same name (differing only in uppercase and lowercase letters) and caseSensitive is FALSE, this method assigns a value only to the first attribute (the first to be created with this name). All other attributes of the same name are ignored.
A, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IFRAME, IMG, INPUT, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, META, NEXTID, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, WBR, XMP, style
Sets the end point of one range based on the end point of another. This method takes two parameters: a string that describes the end points to transfer, and a range from which the source end point will be taken.
object.setEndPoint(type, range)
Parameter Description type String that describes the end point to transfer. Can be one of these values:
StartToEnd StartToStart EndToStart EndToEnd range Text range object specifying the range from which the source end point is to be taken.
No return value.
This feature might not be available on non-Win32 platforms. See article Q172976 in the Microsoft Knowledge Base for the latest information on Internet Explorer cross-platform compatibility.
The following JScript example sets the start point of the current range (r1) to the end point of the second range (r2).
r1.setEndPoint("StartToEnd", r2);
Repeatedly evaluates an expression after a specified number of milliseconds has elapsed.
intervalID = object.setInterval(expression, msec [, language])
Parameter Description expression String containing the script code to execute each time the interval elapses. msec Integer value or numeric string specifying the length of the interval, in milliseconds. language Optional. String specifying the language in which the code is executed.
Returns an integer identifier representing the interval. Use this identifier to clear (stop) the interval.
The following example sets a 15-second interval. Each time the interval elapses, the background color of the document changes.
setInterval("changeColor()", 15000); . . . function changeColor() { if (document.body.bgColor == "red") document.body.bgColor == "blue"; else document.body.bgColor == "red"; }
Evaluates an expression after a specified number of milliseconds has elapsed.
timeoutID = object.setTimeout(expression, msec [, language])
Parameter Description expression (String) Code to be executed at the specified interval. msec (Long) Numeric value or numeric string in millisecond units. language Optional. (String) String that specifies the language in which the code is executed.
Returns an identifier that is used only to cancel the evaluation with the clearTimeout method.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.