Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
getElementById
Collapse the table of content
Expand the table of content

getElementById method

Returns a reference to the first object with the specified ID value.

Internet Explorer 8

 

Syntax


var ppRetElement = document.getElementById(bstrId);

Parameters

bstrId [in]

Type: BSTR

A BSTR that specifies the ID, which is case sensitive.

ppRetElement [out, retval]

Type: IHTMLElement2

The address of a pointer to a variable of type IHTMLElement2 that receives the first object with the ID specified in bstrId.

Return value

Type: HRESULT

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

Remarks

This version of IHTMLDocument6::getElementById requires IE8 Standards mode compatibility. For more information, see Defining Document Compatibility

See also

document
IHTMLDocument3::getElementById

 

 

Community Additions

ADD
Show:
© 2015 Microsoft