namedItem method

[This documentation is preliminary and is subject to change.]

Retrieves an object from an areas collection.


HRESULT retVal = object.namedItem(name, );

Standards information

There are no standards that apply here.


name [in]

Type: BSTR

A BSTR that specifies the IHTMLDOMAttribute2::name or IHTMLElement::id property of the object to retrieve. A collection is returned if more than one match is made.

pdisp [out, retval]

Type: IDispatch

The address of a pointer to a variable that receives an IDispatch interface for the object or collection if successful, or NULL otherwise.

Return value


If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


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

Windows Internet Explorer 8 and later. In IE8 Standards mode, the IHTMLAreasCollection3::namedItem method does not return collections if more than one named item is found; instead, it returns the first case-insensitive matched element. For more information on IE8 mode, see Defining Document Compatibility.

The IHTMLAreasCollection3::namedItem method was introduced in Microsoft Internet Explorer 6



Build date: 6/12/2012

Community Additions