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