Element.insertAdjacentText() (Method)

Insert some text into the document adjacent to this element.


JScript - 3.0
Internet Explorer - 4.0
Property/method value type:undefined
JavaScript syntax:IEmyElement.insertAdjacentHTML(aRelativePosition, aString)
Argument list:aRelativePositionAn indication of where the new HTML is to be placed
aStringThe new fragment of text to be inserted

This is quite similar to an expression that assigns a new value to the innerText property of an Element object. In this case, the new text leaves the existing text and HTML content intact.

The relative positions where the adjacent text can be introduced determine where the new text is to be inserted. The following relative positions can be specified:

AfterBeginImmediately after the opening tag and before any other content
AfterEndImmediately after the closing tag and before any other content
BeforeBeginImmediately before the opening tag
BeforeEndImmediately before the closing tag


See also:Element object, Element.getAdjacentText(), Element.insertAdjacentHTML(), Element.replaceAdjacentText(), Node.insertBefore()

insert figure 0048