Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

namedItem method

Retrieves a select object or an object from an options collection.

Syntax


HRESULT retVal = object.namedItem(name, pdisp);

Parameters

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

Type: HRESULT

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

Standards information

There are no standards that apply here.

Remarks

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.

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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.