Click to return to the Reusing Browser Technology home page    
IHTMLElement::getAttribut...     IHTMLElement::insertAdjac...     IHTMLElement Interface    
Web Workshop  |  Reusing Browser Technology

IHTMLElement::insertAdjacentHTML Method


Inserts the given HTML text into the element object at the given location. If the text contains HTML tags, the method parses and formats the text as it inserts.

Syntax

HRESULT insertAdjacentHTML(
    BSTR where,
    BSTR html
);

Parameters

where
String that specifies where to insert the HTML text. It can be one of the following:

beforeBegin Inserts the text immediately before the element.
afterBegin Inserts the text after the start of the element but before all other content in the element.
beforeEnd Inserts the text immediately before the end of the element but after all other content in the element.
afterEnd Inserts the text immediately after the end of the element.

html
String that specifies the HTML text to insert.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

You cannot insert text while the document is loading. Wait for the onload event before attempting to call this method.

Windows CE

Windows CE Use version 2.12 and later
Minimum availability Internet Explorer 4.0


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.