Home Cooker Classes Others Rice CookerGX
Classes  >  element  >  InsertAdjacentElement(string,element)
element class : InsertAdjacentElement(string,element) method


Inserts an element at the specified position.


elementInstance.InsertAdjacentElement(string where, element targetElement)


stringwhereA string that indicates the position which to insert.
elementtargetElementA Insert element.

Return value

elementA Insert element.

Sample code

//anyElement and targetElement are any instance of element type.

string where = "afterBegin"

element inserted = anyElement.InsertAdjacentElement(where, targetelement);


It's a wrapper of the MSHTML.IHTMLElement2.insertAdjacentElement(String,IHTMLElement).

The following values can specify as the first argument.

beforeBegin: The previous sibling of the invoker element.

afterBegin: The first child of the invoker element.

beforeEnd: The last child of the invoker element.

afterEnd: The next sibling of the invoker element.

If the second argument has children, it move together.

Links for reference

Copyright © Rice All rights reserved.