asp.net.ph

Skip Navigation Links

insertAdjacentText Method

DHTML Methods


Inserts the given text into the element at the given location. The text is inserted as plain text.

Syntax

object.insertAdjacentText ( sWhere, sText ) 
Parameters

sWhere Required. Location to insert the text. This 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.

sText Required. Text to insert.

Return Value

No return value.

Remarks

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

See Also

innerText, insertAdjacentHTML, outerText



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note