Export (0) Print
Expand All

HtmlElement.AppendChild Method (HtmlElement, HtmlElement)

Silverlight

Adds an element at a specified location in the child element collection for the current HTML element.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)

[SecuritySafeCriticalAttribute]
public void AppendChild(
	HtmlElement element,
	HtmlElement referenceElement
)

Parameters

element
Type: System.Windows.Browser.HtmlElement
The element to be added.
referenceElement
Type: System.Windows.Browser.HtmlElement
The location to insert the element. The element is added before referenceElement.

ExceptionCondition
InvalidOperationException

referenceElement is not in the child element collection of the current HTML element.

ArgumentNullException

element is null.

The specified element is inserted before referenceElement in the child element collection of the current HTML element. If referenceElement is null, element is added to the end of the child element collection.

You can also add an element to the end of the child element collection by using the AppendChild(HtmlElement) method overload.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft