Retrieves an object from an areas collection.
retVal = object.item(name, index);
- name [in]
VARIANT of type VT_I4 or VT_BSTR that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching IHTMLDOMAttribute2::name or IHTMLElement::id properties are retrieved, and a collection is returned if more than one match is made.
- index [in, optional]
VARIANT of type VT_I4 that specifies the zero-based index of the object to retrieve when a collection is returned.
There are no standards that apply here.
Windows Internet Explorer 8 and later. In IE8 Standards mode, the index parameter is not used. For more information, see Defining Document Compatibility.
This function returns S_OK even if the element is not found. You should check the value of the pdisp (IDispatch) pointer returned by this call. If the value of the pointer is NULL, the element was not found and the call was not successful.
The IHTMLAreasCollection::item method cannot retrieve input type=image elements from a form. To access all elements contained in a form, call QueryInterface on IHTMLFormElement and request an IHTMLElement interface. Use the children property of the IHTMLElement interface to retrieve a collection of all elements in the form.