length - web automation property

Retrieves the number of objects in a web automation collection.

Applies to:
ElementList
  var len = listObj.length;
Arguments:
None.
Remarks:
Web automation collection objects use zero-based indexes. The last index in a list is length - 1.
Example:
// Displays all anchors in a web page.
var coreObj = new ActiveXObject("OpenTwebst.Core");
var browser = coreObj.StartBrowser("http://www.codecentrix.com/");
var anchors = browser.FindAllElements("a", "");
var text    = "";

for (var i = 0; i < anchors.length; ++i)
{
	text += anchors.item(i).uiName;
	text += "\n";
}

WScript.Echo(text);
		
See also:
ElementList | item

© 2017 CodeCentrix Software. All rights reserved.