NodeExtensions
Useful methods for node objects.
Adopts the given node for the provided document context.
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 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 root of the given node, which is the node itself, if it has
no parent, or the root of the parent.
Checks if the node has any text node children.
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.
Tries to print the CSS representation of the Object, if any.
Otherwise the an empty string is returned.