
Adds an element to the collection.
Before you can add an element to a collection, you must create it first by using the createElement method.
object.add(element [, index])
Parameter Description element Element object to add. index Optional. Number specifying the position within the collection to place the element. If no value is given, the method places the element at the end of the collection.
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.
Presents a dialog box allowing the user to add the channel specified or change its usage if it is already installed.
object.addChannel(urlToCDF)
Parameter Description urlToCDF Required. Specifies the URL of a Channel Definition Format (CDF) file to be installed.
Important Note: This function is only intended for use by publishers shipping Active Channels that are pre-installed with Internet Explorer 4.0. It is included in this documentation for completeness.
Adds a style sheet to the imports collection for the given style sheet.
integer = stylesheet.addImport(url [, index])
Parameter Description url String specifying the location of the source file for the style sheet. index Optional. Integer specifying the requested position of the style sheet in the collection. If this value is not given, the style sheet is added to the end of the collection.
Returns an integer index value specifying the position of the imported style sheet in the imports collection.
The index is a zero-based index value.
Adds an entry to the read-requests queue.
navigator.userProfile.addReadRequest(attributeName [, isRequired], success)
Parameter Description attributeName One of the standard vCard names; otherwise, the request is ignored and nothing is added to the read-requests queue. isRequired Optional. Currently, Internet Explorer ignores this parameter. success Returns TRUE if the request has been added to the queue successfully, or FALSE otherwise. This could mean that either the attribute name was not recognized or the attribute had already appeared in the request queue.
Creates a new style rule for the styleSheet object and returns the index into the Rules collection. Rules can be added to a disabled styleSheet, but they will not apply to the document unless the styleSheet has been enabled.
integer = object.addRule(selector, style [, index])
Parameter Description selector String specifying the selector for the new rule. Single contextual selectors are valid. For example, "DIV P B" is a valid contextual selector. style String specifying the style assignments for this style rule. This style takes the same form as an inline style specification. For example, "color:blue" is a valid style parameter. index Integer that specifies where in the Rules collection to add the new style rule. This is an optional parameter. If an index is not provided, the rule will be added to the end of the Rules collection by default.
The return value is reserved; do not use.
The following example adds a rule to the beginning of the Rules collection for all text in BOLD that appears in a <DIV> <P> tag to be set to the color blue.
var new_rule; new_rule = styleSheets[0].addRule("DIV P B", "color:blue", 0);
NOTE: When manipulating stylesheets through the Object Model, you will not be able to addRule() where the style is "position" to an element which doesn't already have positioning set for it. You can, however, add a rule to the object to make it "position:absolute" if the object has already been set to "position:relative" (and vice versa).
Displays an Alert dialog box with a message and an OK button.
object.alert([message])
Parameter Description message Optional. (String) String to display.
No return value.
The title bar of the Alert dialog box cannot be changed.
Sets the current location to url. This method loads the given document specified by url if it exists.
object.assign(url)
Parameter Description url String specifying the URL of the document to assign.
No return value.
Loads the previous URL in the History list.
object.back( )
No return value.
This method performs the same action as a user choosing the Back button in the browser. The back method is the same as history.go(-1). Trying to go past the beginning of the history does not generate an error. Instead, you are left at the current page.
Causes an object to lose focus and fires the onblur event.
object.blur( )
No return value.
A, APPLET, AREA, BODY, BUTTON, CAPTION, DIV, EMBED, FIELDSET, FRAME, FRAMESET, HR, IFRAME, IMG, INPUT, MARQUEE, OBJECT, SELECT, SPAN, TABLE, TD, TEXTAREA, TR, window
Clears the contents of the selection.
object.clear( )
No return value.
Clears the current document.
object.clear( )
No return value.
Cancels the interval previously started using the setInterval method.
object.clearInterval(intervalID)
Parameter Description intervalID Integer specifying which interval to cancel. This value must have been previously returned by the setInterval method.
No return value.
Clears the compound request, cleaning the slate for building a new request for profile access.
navigator.userProfile.clearRequest
No return value.
Cancels a time-out that was set with the setTimeout method.
object.clearTimeout(timeoutID)
Parameter Description timeoutID (Long) Time-out setting that was returned by a previous call to the setTimeout method.
No return value.
Simulates a click by causing the onclick event to fire.
object.click( )
No return value.
A, ADDRESS, APPLET, AREA, B, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, INPUT, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP
Closes the current browser window.
object.close( )
No return value.
Closes an output stream and forces data sent to layout to display.
object.close( )
No return value.
Moves the insertion point to the beginning or the end of the current range.
object.collapse([start])
Parameter Description start Optional. (Boolean) False moves the insertion point to the end of the text range. True (default) moves the insertion point to the beginning of the text range.
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.
Compares the two end points and returns -1, 0, or 1 for less than, equal to, or greater than, respectively.
object.compareEndPoints(type, range)
Parameter Description type String that describes the end point to compare. 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.
Returns the result of the comparison.
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.
Displays a Confirm dialog box with the specified message, and OK and Cancel buttons.
object.confirm([message])
Parameter Description message Optional. (String) String to display.
Returns TRUE if the user chooses OK, or FALSE if the user chooses Cancel.
You have no control over the dialog box title.
Checks whether the given element is contained within the current element.
Boolean = object.contains(element)
Parameter Description element Element object specifying the element to check.
Returns TRUE if the element is contained, or FALSE otherwise.
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
Creates an empty CAPTION element in the TABLE. If a CAPTION already exists, createCaption() returns the existing element, otherwise, it returns a pointer to the element created.
object.createCaption()
Returns the CAPTION element object. If the method fails, it returns null.
The following example creates a caption,
myCaption = document.all.myTable.createCaption()
table
createTFoot, createTHead, deleteTHead, deleteTFoot, deleteCaption
Creates an instance of the element object for the specified tag. Only new IMG and OPTION elements can be created. Before they can be used, new objects must be explicitly added to their respective collections.
element = object.createElement(tag)
Parameter Description tag (String) Tag specifier.
Returns an element object.
Creates a text range object from the current selection.
object.createRange( )
Creates a style sheet.
object.createStyleSheet(url, index)
Parameter Description url Optional string that indicates how the style sheet will be added to the document. If a URL is not supplied (default), the style information supplied in the URL will be added as a <style> object. If a URL is specified, the style information will be added as a <link> object. index Optional integer indicating where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style at the end of the collection.
Returns a styleSheet object.
Creates a text range object for the given object. You use a text range to examine and modify the text within an object.
TextRange = object.createTextRange( )
Returns a text range object if successful, or NULL otherwise.
The following JScript example creates a text range for the document, then uses the range to display all text and HTML tags in the document.
var rng = document.body.createTextRange( ); if (rng!=null) { alert(rng.htmlText); }The following JScript example creates a text range for the first BUTTON element in the document, then uses the text range to change the text in the button.
var coll = document.all.tags("BUTTON"); if (coll!=null && coll.length>0) { var rng = coll[0].createTextRange(); rng.text = "Clicked"; }
Creates an empty THEAD element in the TABLE. If a THEAD already exists, createTHead returns the existing element, otherwise, it returns a pointer to the element created.
object.createTHead()
Returns the THead element object. If the method fails, it returns null.
The following example creates a THEAD,
myTHead = document.all.myTable.createTHead()
table
createTFoot, createCaption, deleteTHead, deleteTFoot, deleteCaption
Creates an empty TFOOT element in the TABLE. If a TFOOT already exists for the TABLE, createTFoot returns the existing element, otherwise, it returns a pointer to the element created.
object.createTFoot()
Returns the THead element object. If the method fails, it returns null.
The following example creates a TFOOT,
myTFoot = document.all.myTable.createTFoot()
table
createTHead, createCaption, deleteTHead, deleteTFoot, deleteCaption
Deletes the Caption element and its contents from the TABLE.
object.deleteCaption()
No return value.
The following example deletes the caption,
document.all.myTable.deleteCaption()
table
createTFoot, createTHead, createCaption, deleteTFoot, deleteTHead
Deletes the specified cell (TD) in the table row and removes the cell from the cells collection. You can specify a cellIndex for the cell to be deleted from the TD, or without a cellIndex, the last cell in the cells collection will be deleted.
object.deleteCell(index)
No return value. Index specifies which element in the cells collection to remove.
The following example deletes the last cell in the first row of the table
document.all.myTable.rows[0].deleteCell()
Deletes the specified row (TR) in the table and removes the row from the rows collection. Deleting a row from a TFOOT, TBODY, or THEAD also removes the row from the rows collection for the TABLE. Deleting a row in the TABLE, removes a row from the rows collection for the TBODY. However, when specifying the index for the row to be deleted, you must specify the sectionRowIndex if the row is being deleted from a TBODY, TFOOT or THEAD. You must specify the rowIndex if the row is being deleted from the TABLE.
object.deleteRow(index)
No return value Index specifies which element in the rows collection to remove.
The following example deletes the specified row (TR) in the table,
myNewRow = document.all.myTable.deleteRow()
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.