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

Description

Inserts an element at the specified position.

Syntax

elementInstance.InsertAdjacentElement(string where, element targetElement)

Arguments

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

Return value

ClassDescription
elementA Insert element.

Sample code

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

string where = "afterBegin"

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

Notes

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.