IParentNode Interface
https://dom.spec.whatwg.org/#interface-parentnode
public interface IParentNodeProperties
| Name | Description |
|---|---|
| ChildElementCount | Gets the number of child elements. |
| Children | Gets the live collection of the child elements. |
| FirstElementChild | Gets the first child that is an element, or null when there is none. |
| LastElementChild | Gets the last child that is an element, or null when there is none. |
ChildElementCount
Gets the number of child elements.
uint ChildElementCount { get; }Children
Gets the live collection of the child elements.
HtmlCollection Children { get; }FirstElementChild
Gets the first child that is an element, or null when there is none.
Element? FirstElementChild { get; }LastElementChild
Gets the last child that is an element, or null when there is none.
Element? LastElementChild { get; }Methods
| Name | Description |
|---|---|
| Append(ReadOnlySpan<NodeOrString>) | Inserts the nodes after the last child, converting the strings into text nodes. |
| MoveBefore(Node, Node?) | Moves the node, preserving its state, before the given child (or to the end when the child is null). |
| Prepend(ReadOnlySpan<NodeOrString>) | Inserts the nodes before the first child, converting the strings into text nodes. |
| QuerySelector(SelectorList) | Returns the first inclusive descendant, in tree order, that matches the parsed selector (https://dom.spec.whatwg.org/#dom-parentnode-queryselector). |
| QuerySelector(string) | Returns the first descendant element, in tree order, that matches the selectors, or null. |
| QuerySelectorAll(SelectorList) | Returns the descendants, in tree order, that match the parsed selector (https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall). |
| QuerySelectorAll(string) | Returns the descendant elements, in tree order, that match the selectors. |
| ReplaceChildren(ReadOnlySpan<NodeOrString>) | Replaces all the children with the given nodes, converting the strings into text nodes. |
Append(ReadOnlySpan<NodeOrString>)
Inserts the nodes after the last child, converting the strings into text nodes.
void Append(params scoped ReadOnlySpan<NodeOrString> nodes)Parameters
See also
MoveBefore(Node, Node?)
Prepend(ReadOnlySpan<NodeOrString>)
Inserts the nodes before the first child, converting the strings into text nodes.
void Prepend(params scoped ReadOnlySpan<NodeOrString> nodes)Parameters
See also
QuerySelector overloads
QuerySelector(SelectorList)
Returns the first inclusive descendant, in tree order, that matches the parsed selector (https://dom.spec.whatwg.org/#dom-parentnode-queryselector).
Element? QuerySelector(SelectorList selectors)QuerySelector(string)
Returns the first descendant element, in tree order, that matches the selectors, or null.
QuerySelectorAll overloads
QuerySelectorAll(SelectorList)
Returns the descendants, in tree order, that match the parsed selector (https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall).
NodeList QuerySelectorAll(SelectorList selectors)QuerySelectorAll(string)
Returns the descendant elements, in tree order, that match the selectors.
ReplaceChildren(ReadOnlySpan<NodeOrString>)
Replaces all the children with the given nodes, converting the strings into text nodes.
void ReplaceChildren(params scoped ReadOnlySpan<NodeOrString> nodes)