childrenchildren*
*Contents  *Index  *Topic Contents
*Previous Topic: cells
*Next Topic: elements

children

Description

Retrieves only the direct descendants of an element. The elements contained in this collection are undefined if the child elements are overlapping tags. Similar to the all collection.

Syntax

object.children(index)

ParameterDescription
object The document object.
(index) Optional. An integer or a string specifying the index value of the element to retrieve. Integer indexes are zero-based, meaning the first element in the collection has index 0. A string index is valid only if the string is a name or identifier of at least one element in the document.

Remarks

The following example illustrates what this collection would return.

<DIV id=divONE>
<IMG src=mygif.gif>
<DIV id=divTWO>
<p>Some text in a paragraph
</DIV>
<BUTTON> The label for the button </BUTTON>
</DIV>

The children collection for divONE would include IMG, DIV, and BUTTON. The children collection for divTWO would include P.

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, 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, INS, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.