最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

all Collection

Internet Development Index

Returns a reference to the collection of elements contained by the object.

Syntax

[ collAll = ] object.all
[ oObject = ] object.all(vIndex [, iSubIndex])

Possible Values

collAllArray of elements contained by the object.
oObjectReference to an individual item in the array of elements contained by the object.
vIndexRequired. Integer or string that specifies the element or collection to retrieve. If this parameter is an integer, the method returns the element in the collection at the given position, where the first element has value 0, the second has 1, and so on. If this parameter is a string and there is more than one element with the name or id property equal to the string, the method returns a collection of matching elements.
iSubIndexOptional. Position of an element to retrieve. This parameter is used when vIndex is a string. The method uses the string to construct a collection of all elements that have a name or id property equal to the string, and then retrieves from this collection the element at the position specified by iSubIndex.

Members Table

PropertyDescription
length Sets or retrieves the number of objects in a collection.
MethodDescription
item Retrieves an object from the all collection or various other collections.
namedItem   Retrieves an object or a collection from the specified collection.
tags Retrieves a collection of objects that have the specified HTML tag name.
urns Retrieves a collection of all objects to which a specified behavior is attached.

Remarks

The all collection includes one element object for each valid HTML tag. If a valid tag has a matching end tag, both tags are represented by the same element object.

The collection returned by the document's all collection always includes a reference to the HTML, HEAD, and TITLE objects regardless of whether the tags are present in the document. If the BODY tag is not present, but other HTML tags are, a BODY object is added to the all collection.

If the document contains invalid or unknown tags, the collection includes one element object for each. Unlike valid end tags, unknown end tags are represented by their own element objects. The order of the element objects is the HTML source order. Although the collection indicates the order of tags, it does not indicate hierarchy.

The name property only applies to some elements such as form elements. If the vIndex is set to a string matching the value of a name property in an element that the name property does not apply, then that element will not be added to the collection.

Examples

This example, in Microsoft® JScript® (compatible with ECMA 262 language specification), shows how to display the names of all tags in the document in the order the tags appear in the document.

for(i = 0; i < document.all.length; i++){
alert(document.all(i).tagName);
}

This example, also in JScript, shows how to use the item method on the all collection to retrieve all element objects for which the name property or ID attribute is set to sample. Depending on the number of times the name or ID is defined in the document, the item method returns null, a single element object, or a collection of element objects. The value of the length property of the collection determines whether item returns a collection or a single object.

var oObject = document.all.item("sample");
if (oObject != null){
if (oObject.length != null){
for (i = 0; i < oObject.length; i++){
alert(oObject(i).tagName);
}
}
else{
alert(oObject.tagName);
}
} 

Standards Information

There is no public standard that applies to this collection.

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, CUSTOM, DD, DEL, DFN, DIR, DIV, DL, document, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, HEAD, hn, HR, HTML, I, IFRAME, IMG, INS, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP
柳州市| 凉城县| 如皋市| 永年县| 凌云县| 西乌| 河津市| 康乐县| 石屏县| 盱眙县| 安丘市| 台中市| 仁寿县| 穆棱市| 湖州市| 竹山县| 怀安县| 丹阳市| 巢湖市| 平舆县| 海宁市| 秭归县| 甘谷县| 晋州市| 尚义县| 固原市| 怀来县| 万山特区| 泰安市| 巩留县| 定州市| 新沂市| 甘南县| 莱州市| 河津市| 县级市| 渝北区| 景宁| 广河县| 三台县| 明水县|