1 out of 8 rated this helpful Rate this topic

insertAdjacentText Method

.NET Framework 3.0

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

Syntax

object.insertAdjacentText(sWhere, sText)

Parameters

sWhere Required. String 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.
sText Required. 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.

Standards Information

There is no public standard that applies to this method.

Applies To

A, ABBR, ACRONYM, ADDRESS, APPLET, AREA, ARTICLE, ASIDE, B, BDO, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, CUSTOM, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FIGCAPTION, FIGURE, FONT, FOOTER, FORM, FRAME, FRAMESET, HEAD, HEADER, HGROUP, hn, HR, HTML, 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, INS, ISINDEX, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARK, MARQUEE, MENU, NAV, nextID, NOBR, OBJECT, OL, OPTGROUP, OPTION, P, PLAINTEXT, PRE, Q, RT, RUBY, S, SAMP, SECTION, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP, Element Constructor

See Also

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ