insertAdjacentText Method

DHTML, HTML, & CSS

insertAdjacentText Method


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

Syntax

object.insertAdjacentText(sWhere, sText)

Parameters

sWhereRequired. String that specifies where to insert the text, using one of the following values:
beforeBeginInserts the text immediately before the element.
afterBeginInserts the text after the start of the element but before all other content in the element.
beforeEndInserts the text immediately before the end of the element but after all other content in the element.
afterEndInserts the text immediately after the end of the element.
sTextRequired. String that specifies the text to insert.

Return Value

No return value.

Remarks

The text inserted into the element is plain text

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

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, ADDRESS, AREA, B, BASEFONT, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COMMENT, custom, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FONT, FORM, FRAMESET, Hn, HR, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, NOBR, OL, OPTION, P, PRE, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TD, TEXTAREA, TH, TT, U, UL, VAR

See Also

innerText, insertAdjacentHTML, outerText


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.