ElementExtensions
Useful methods for element objects.
Adds the specified class name(s) for all elements in the given
collection.
Inserts the nodes generated from the given HTML code after
each element of the provided elements.
Appends the nodes generated from the given HTML code to each
element of the provided elements.
public static T Attr<T>(this T elements, string attributeName, string attributeValue) where T : IEnumerable<IElement>
Sets the specified attribute name to the specified value for all
elements in the given collection.
public static T Attr<T>(this T elements, IEnumerable<KeyValuePair<string, string>> attributes) where T : IEnumerable<IElement>
Sets the specified attribute name to the specified value for all
elements in the given collection.
Sets the specified attribute name to the specified value for all
elements in the given collection.
public static IEnumerable<string> Attr<T>(this T elements, string attributeName) where T : IEnumerable<IElement>
Gets the values of the specified attribute for all elements in the
given collection.
Inserts the nodes generated from the given HTML code before
each element of the provided elements.
Clears the attributes of the given element.
Clears the attributes of all elements.
Creates a new resource request from the provided element for the
given url.
Empties the provided element.
Empties all provided elements.
Gets the CSS namespace that is defined via the provided prefix.
Gets the non-fixed namespace of the element.
Returns the property attribute. Widely used for meta tags for Open Graph protocols
Creates a unique selector path used to locate the element in the DOM.
Checks if any element in the given collection has the given
class(es).
Gets the inner HTML of the given element.
Sets the inner HTML of the given elements.
Checks if the element is currently active.
Checks if the element is currently checked.
Checks if the element is an input element that is currently in its default state.
Checks if the element is currently disabled.
Checks if the element is editable.
Checks if the element is currently enabled.
Checks if the element is its parent's first child.
Checks if the element is the first of its type among the parent's children.
Checks if the element is currently hovered. Not implemented, and
will always return false.
Checks if the element is currently in its indeterminate state.
Checks if the element's value is within the range.
Checks if the element does not validate.
Checks if the element is its parent's last child.
Checks if the element is the last of its type among the parent's children.
Checks if the element is a link.
Checks if the input can be changed.
Checks if the textarea can be changed.
Checks if the element is its parent's only child.
Checks if the element is the only of its type among the parent's children.
Checks if the element is only optional and not required.
Checks if the element's value is out-of-range.
Checks if the element is currently showing a placeholder.
Checks if the element is a pseudo element (before or after).
Checks if the element is readonly.
Checks if the element is required and must be filled out.
Checks if the element hosts a shadow tree.
Checks if the element is currently targeted.
Checks if the element is currently unchecked.
Checks if the element does validate.
Checks if the element is visible on screen. Not implemented, and
will always return false.
Checks if the element has already been visited.
Locates the namespace of the given prefix.
Locates the prefix of the given namespace.
Checks if the element with the provided prefix matches the CSS
namespace.
public static Task<IDocument> NavigateAsync<TElement>(this TElement element) where TElement : IUrlUtilities, IElement
Navigates to the hyper reference given by the provided element
without any possibility for cancellation.
public static Task<IDocument> NavigateAsync<TElement>(this TElement element, CancellationToken cancel) where TElement : IUrlUtilities, IElement
Navigates to the hyper reference given by the provided element.
Prepends the nodes generated from the given HTML code to each
element of the provided elements.
Removes the specified class name(s) for all elements in the given
collection.
Sets the property value
public static IHtmlCollection<TElement> ToCollection<TElement>(this IEnumerable<TElement> elements) where TElement : IElement
Creates a new HTML Collection from the provided elements.
Toggles the specified class name(s) for all elements in the given
collection.
public static bool TryLocateCustomNamespace(this IElement element, string prefix, out string namespaceUri)
Tries to locate a custom namespace URI.
Tries to locate the standard namespace URI.
Wraps the given elements in the inner most element of the tree
generated form the provided HTML code.
Wraps all elements in the inner most element of the tree
generated form the provided HTML code. The tree is appended before
the first element of the given list.
Wraps the content of the given elements in the inner most element
of the tree generated form the provided HTML code.