NodeExtensions
Useful methods for node objects.
Ensures the validity for inserting the given node at parent before the
provided child. Throws an error is the insertation is invalid.
Tries to find a direct child of a certain type.
Tries to find a descendant of a certain type.
Gets the first ancestor node that is of the specified type.
Gets the ancestor nodes of the provided node, in tree order.
Gets the associated host object, if any. This is mostly interesting for the HTML5 template tag.
Gets the descendant nodes of the provided parent, in tree order.
Gets the element count of the given node.
Gets the inclusive ancestor nodes of the provided node, in tree order.
Gets the root of the given node, which is the node itself, if it has
no parent, or the root of the parent.
Checks if any parent is an HTML datalist element..
Checks if the node has any text node children.
Gets the hyperreference of the given URL - transforming the given
(relative) URL to an absolute URL if required.
Gets the index of the provided node in the node's parent's collection.
Finds the index of the given node of the provided parent node.
Checks if the parent is an ancestor of the given node.
Checks if the node is an descendant of the given parent.
Checks if the given child is followed by a document type.
Checks if the context node is after the provided node.
Checks for an inclusive ancestor relationship or if the host (if any) has such a relationship.
Checks if the parent is an inclusive ancestor of the given node.
Checks if the node is an inclusive descendant of the given parent.
Checks if the given child is preceded by an element node.
Checks if the context node is before the provided node.
Checks if the current node is a sibling of the specified element.
Pre-inserts the given node at the parent before the provided child.
Pre-removes the given child of the parent.