Share via


insertAdjacentText method

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

Inserts the given text into the element at the specified location.

Syntax

HRESULT retVal = object.insertAdjacentText(where, text);

Standards information

There are no standards that apply here.

Parameters

where [in]

Type: BSTR

BSTR that specifies where to insert the text, using one of the following values:

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.

text [in]

Type: BSTR

BSTR that specifies the text to insert.

Return value

Type: HRESULT

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

Remarks

The text inserted into the element is plain text

You cannot insert text while the document loads. Wait for the HTMLFrameSiteEvents::onload event to fire before attempting to call this method.

See also

Reference

IHTMLElement::innerText

IHTMLElement::insertAdjacentHTML

IHTMLElement::outerText

 

 

Build date: 6/12/2012