IHTMLAreasCollection4::namedItem Method

Retrieves an object or a collection from a specified collection.

Syntax


HRESULT namedItem(
    BSTR name,
    IHTMLElement2 **pNode
);

Parameters

name
[in] A BSTR that specifies the name or id property of the object to retrieve.
pNode
[out, retval] The address of a pointer to a variable that receives an IHTMLElement2 interface for the object or collection if successful, or NULL otherwise.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

This method first searches for an object with a matching id attribute. If a match is not found, then the method searches for an object with a matching name attribute, but only on those elements that are allowed a name attribute.

Show: